File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1308,8 +1308,6 @@ def weekofyear(self):
1308
1308
weekofyear and week have been deprecated.
1309
1309
Please use DatetimeIndex.isocalendar().week instead.
1310
1310
"""
1311
- import pandas as pd
1312
-
1313
1311
warnings .warn (
1314
1312
"weekofyear and week have been deprecated, please use "
1315
1313
"DatetimeIndex.isocalendar().week instead, which returns "
@@ -1319,7 +1317,10 @@ def weekofyear(self):
1319
1317
FutureWarning ,
1320
1318
stacklevel = 3 ,
1321
1319
)
1322
- return pd .Int64Index (self .isocalendar ().week )
1320
+ week_series = self .isocalendar ().week
1321
+ if week_series .hasnans :
1322
+ return week_series .astype ("float64" ).values
1323
+ return week_series .astype ("int64" ).values
1323
1324
1324
1325
week = weekofyear
1325
1326
You can’t perform that action at this time.
0 commit comments