to_period(self, freq=None) -> 'PeriodArray'
Converts DatetimeArray/Index to PeriodArray/Index.
One of pandas' offset strings <timeseries.offset_aliases>
or an Offset object. Will be inferred by default.
When converting a DatetimeArray/Index with non-regular values, so that a frequency cannot be inferred.
Cast to PeriodArray/Index at a particular frequency.
DatetimeIndex.to_pydatetime
Return DatetimeIndex as object.
PeriodIndex
Immutable ndarray holding ordinal values.
>>> df = pd.DataFrame({"y": [1, 2, 3]},
... index=pd.to_datetime(["2000-03-31 00:00:00",
... "2000-05-31 00:00:00",
... "2000-08-31 00:00:00"]))
... df.index.to_period("M") PeriodIndex(['2000-03', '2000-05', '2000-08'], dtype='period[M]')
Infer the daily frequency
This example is valid syntax, but we were not able to check execution>>> idx = pd.date_range("2017-01-01", periods=2)See :
... idx.to_period() PeriodIndex(['2017-01-01', '2017-01-02'], dtype='period[D]')
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them