Skip to content

Update offset prefix map #5383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/source/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ API Changes
- store `datetime.date` objects as ordinals rather then timetuples to avoid
timezone issues (:issue:`2852`), thanks @tavistmorph and @numpand
- ``numexpr`` 2.2.2 fixes incompatiblity in PyTables 2.4 (:issue:`4908`)

- ``JSON``

- added ``date_unit`` parameter to specify resolution of timestamps.
Expand Down Expand Up @@ -503,6 +504,7 @@ Bug Fixes
names weren't strings (:issue:`4956`)
- A zero length series written in Fixed format not deserializing properly.
(:issue:`4708`)

- Fixed bug in tslib.tz_convert(vals, tz1, tz2): it could raise IndexError
exception while trying to access trans[pos + 1] (:issue:`4496`)
- The ``by`` argument now works correctly with the ``layout`` argument
Expand Down Expand Up @@ -755,6 +757,7 @@ Bug Fixes
- Bug when renaming then set_index on a DataFrame (:issue:`5344`)
- Test suite no longer leaves around temporary files when testing graphics. (:issue:`5347`)
(thanks for catching this @yarikoptic!)
- Add missing entries to ``tseries.offsets.prefix_mapping`` (:issue: `5382`)

pandas 0.12.0
-------------
Expand Down
31 changes: 3 additions & 28 deletions pandas/tseries/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
'MonthBegin', 'BMonthBegin', 'MonthEnd', 'BMonthEnd',
'YearBegin', 'BYearBegin', 'YearEnd', 'BYearEnd',
'QuarterBegin', 'BQuarterBegin', 'QuarterEnd', 'BQuarterEnd',
'LastWeekOfMonth', 'FY5253Quarter', 'FY5253',
'Week', 'WeekOfMonth',
'FY5253Quarter', 'FY5253',
'Week', 'WeekOfMonth', 'LastWeekOfMonth',
'Hour', 'Minute', 'Second', 'Milli', 'Micro', 'Nano']

# convert to/from datetime/timestamp to allow invalid Timestamp ranges to pass thru
Expand Down Expand Up @@ -1848,32 +1848,7 @@ def generate_range(start=None, end=None, periods=None,
raise ValueError('Offset %s did not increment date' % offset)
cur = next_date

prefix_mapping = dict((offset._prefix, offset) for offset in [
YearBegin, # 'AS'
YearEnd, # 'A'
BYearBegin, # 'BAS'
BYearEnd, # 'BA'
BusinessDay, # 'B'
BusinessMonthBegin, # 'BMS'
BusinessMonthEnd, # 'BM'
BQuarterEnd, # 'BQ'
BQuarterBegin, # 'BQS'
CustomBusinessDay, # 'C'
MonthEnd, # 'M'
MonthBegin, # 'MS'
Week, # 'W'
Second, # 'S'
Minute, # 'T'
Micro, # 'U'
QuarterEnd, # 'Q'
QuarterBegin, # 'QS'
Milli, # 'L'
Hour, # 'H'
Day, # 'D'
WeekOfMonth, # 'WOM'
FY5253,
FY5253Quarter,
])
prefix_mapping = dict([(locals()[offset]._prefix, offset) for offset in __all__])

if not _np_version_under1p7:
# Only 1.7+ supports nanosecond resolution
Expand Down