Skip to content

Commit f61097c

Browse files
committed
Clean up example to use a single Series
1 parent e3d5499 commit f61097c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

pandas/core/indexes/accessors.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,15 @@ def isocalendar(self):
239239
240240
Examples
241241
--------
242-
>>> pd.to_datetime(pd.Series(["2020-01-01"])).dt.isocalendar
243-
year week day
244-
0 2020 1 3
245242
>>> ser = pd.to_datetime(pd.Series(["2010-01-01", pd.NaT]))
246243
>>> ser.dt.isocalendar
247-
year week day
248-
0 2009.0 53.0 5.0
249-
1 NaN NaN NaN
250-
>>> pd.to_datetime(pd.Series(["2019-12-31"])).dt.isocalendar.week
251-
0 1
252-
Name: week, dtype: int32
244+
year week day
245+
0 2009 53 5
246+
1 <NA> <NA> <NA>
247+
>>> ser.dt.isocalendar.week
248+
0 53
249+
1 <NA>
250+
Name: week, dtype: Int64
253251
"""
254252
return self._get_values().isocalendar.set_index(self._parent.index)
255253

0 commit comments

Comments
 (0)