You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/timeseries.rst
+36-3
Original file line number
Diff line number
Diff line change
@@ -299,8 +299,10 @@ intelligent functionality like selection, slicing, etc.
299
299
ts[:5].index
300
300
ts[::2].index
301
301
302
-
Partial String Indexing
303
-
~~~~~~~~~~~~~~~~~~~~~~~
302
+
.. _timeseries.partialindexing:
303
+
304
+
DatetimeIndex Partial String Indexing
305
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304
306
305
307
You can pass in dates and strings that parse to dates as indexing parameters:
306
308
@@ -1092,7 +1094,38 @@ objects:
1092
1094
1093
1095
.. ipython:: python
1094
1096
1095
-
Series(randn(len(prng)), prng)
1097
+
ps = Series(randn(len(prng)), prng)
1098
+
ps
1099
+
1100
+
PeriodIndex Partial String Indexing
1101
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1102
+
1103
+
You can pass in dates and strings to `Series` and `DataFrame` with `PeriodIndex`, as the same manner as `DatetimeIndex`. For details, refer to :ref:`DatetimeIndex Partial String Indexing <timeseries.partialindexing>`.
1104
+
1105
+
.. ipython:: python
1106
+
1107
+
ps['2011-01']
1108
+
1109
+
ps[datetime(2011, 12, 25):]
1110
+
1111
+
ps['10/31/2011':'12/31/2011']
1112
+
1113
+
Passing string represents lower frequency than `PeriodIndex` returns partial sliced data.
0 commit comments