API: remove datetime-like index ops from Series by jreback · Pull Request #7206 · pandas-dev/pandas (original) (raw)

not the usage of Series.weekday could be ambiguous (and applies to all of the properties), IF the series contains a datetimeindex as well (or periodindex)

In [1]: s      = Series(pd.date_range('20130101',periods=3),index=pd.date_range('20130104',periods=3))

In [2]: s
Out[2]: 
2013-01-04   2013-01-01
2013-01-05   2013-01-02
2013-01-06   2013-01-03
Freq: D, dtype: datetime64[ns]

In [3]: s.index.weekday
Out[3]: array([4, 5, 6])

In [4]: pd.DatetimeIndex(s).weekday
Out[4]: array([1, 2, 3])