0

If I create a date time index like this

idx = pd.DatetimeIndex(['2000-12-31', '2001-01-02', '2001-01-03', '2001-01-04', '2001-01-05', '2001-12-31'], dtype='datetime64[ns]', name='date', freq=None)

and then look at the week number property of the dates

idx.week

I get the result

Int64Index([52, 1, 1, 1, 1, 1], dtype='int64', name='date')

But this seems strange, I would expect the date '2001-12-31' to be mapped to week number 52, but it's mapped to 1. Am I missing something here, or is this a bug? I'm using pandas version 0.20.1

CDspace
  • 2,639
  • 18
  • 30
  • 36
mark
  • 635
  • 1
  • 6
  • 11

0 Answers0