为什么假日在Pandas USFederalHolidayCalendar中编码为MemorialDay?

时间:2017-06-02 14:50:35

标签: python pandas

以下是pandas中提供的USFederalHolidayCalendar中的假日规则列表:

>>> from pandas.tseries.holiday import USFederalHolidayCalendar
>>> USFederalHolidayCalendar().rules
[Holiday: New Years Day (month=1, day=1, observance=<function nearest_workday at 0x7f735dbb5158>),
 Holiday: Dr. Martin Luther King Jr. (month=1, day=1, offset=<DateOffset: kwds={'weekday': MO(+3)}>),
 Holiday: Presidents Day (month=2, day=1, offset=<DateOffset: kwds={'weekday': MO(+3)}>),
 Holiday: MemorialDay (month=5, day=31, offset=<DateOffset: kwds={'weekday': MO(-1)}>),
 Holiday: July 4th (month=7, day=4, observance=<function nearest_workday at 0x7f735dbb5158>),
 Holiday: Labor Day (month=9, day=1, offset=<DateOffset: kwds={'weekday': MO(+1)}>),
 Holiday: Columbus Day (month=10, day=1, offset=<DateOffset: kwds={'weekday': MO(+2)}>),
 Holiday: Veterans Day (month=11, day=11, observance=<function nearest_workday at 0x7f735dbb5158>),
 Holiday: Thanksgiving (month=11, day=1, offset=<DateOffset: kwds={'weekday': TH(+4)}>),
 Holiday: Christmas (month=12, day=25, observance=<function nearest_workday at 0x7f735dbb5158>)]

阵亡将士纪念日是MemorialDay,而所有其他假期在名称中都有空格吗?

1 个答案:

答案 0 :(得分:1)

这被报告为错误并已解决。 https://github.com/pandas-dev/pandas/issues/9760