diff --git a/doc/source/release.rst b/doc/source/release.rst index 49de8dddd7210..32ec73284ea88 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -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. @@ -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 @@ -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 ------------- diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 8830d66b245ef..55a05eb677cbb 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -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 @@ -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