Skip to content

No str for FY5253Quarter #12379

Open
Open
@cancan101

Description

@cancan101
from pandas.tseries.offsets import FY5253Quarter

offset_fyq = FY5253Quarter(weekday=6, startingMonth=12,
                       variation="last", qtr_with_extra_week=4)

str(pd.Period("2011-1-2", freq=offset_fyq))
ValueError                                Traceback (most recent call last)
<ipython-input-1-b92e5a634df4> in <module>()
      5                        variation="last", qtr_with_extra_week=4)
      6 
----> 7 str(Period("2011-1-2", freq=offset_fyq))

pandas/src/period.pyx in pandas._period.Period.__init__ (pandas/src/period.c:12139)()

/Users/alex/.virtualenvs/work/lib/python2.7/site-packages/pandas/tseries/frequencies.pyc in get_freq_code(freqstr)
    253             # e.g., freqstr = ('T', 5)
    254             try:
--> 255                 code = _period_str_to_code(freqstr[0])
    256                 stride = freqstr[1]
    257             except:

/Users/alex/.virtualenvs/work/lib/python2.7/site-packages/pandas/tseries/frequencies.pyc in _period_str_to_code(freqstr)
    809                           FutureWarning, stacklevel=3)
    810         except KeyError:
--> 811             raise ValueError("Unknown freqstr: %s" % freqstr)
    812 
    813         return _period_code_map[alias]

ValueError: Unknown freqstr: REQ-L-DEC-SAT-4

Expected: '2010Q4'.

See for more tests: https://github.com/pydata/pandas/pull/5148/files#diff-f9b276c4aa39a6161726d8b43ce62516R2420

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions