以下是熊猫提供的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,而其他所有假期的名称中都有空格吗?

最佳答案

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

10-08 19:31