Immutable Index of timedelta64 data.
Represented internally as int64, and scalars returned Timedelta objects.
Optional timedelta-like data to construct index with.
The unit of data
.
Deprecated since version 2.2.0: Use pd.to_timedelta
instead.
One of pandas date offset strings or corresponding objects. The string 'infer'
can be passed in order to set the frequency of the index as the inferred frequency upon creation.
Valid numpy
dtypes are timedelta64[ns]
, timedelta64[us]
, timedelta64[ms]
, and timedelta64[s]
.
Make a copy of input array.
Name to be stored in the index.
Attributes
Number of days for each element.
Number of seconds (>= 0 and less than 1 day) for each element.
Number of microseconds (>= 0 and less than 1 second) for each element.
Number of nanoseconds (>= 0 and less than 1 microsecond) for each element.
Return a DataFrame of the individual resolution components of the Timedeltas.
Tries to return a string representing a frequency generated by infer_freq.
Methods
to_pytimedelta
(*args, **kwargs)
Return an ndarray of datetime.timedelta objects.
to_series
([index, name])
Create a Series with both index and values equal to the index keys.
round
(*args, **kwargs)
Perform round operation on the data to the specified freq.
floor
(*args, **kwargs)
Perform floor operation on the data to the specified freq.
ceil
(*args, **kwargs)
Perform ceil operation on the data to the specified freq.
to_frame
([index, name])
Create a DataFrame with a column containing the Index.
mean
(*[, skipna, axis])
Return the mean value of the Array.
Notes
To learn more about the frequency strings, please see this link.
Examples
>>> pd.TimedeltaIndex(['0 days', '1 days', '2 days', '3 days', '4 days']) TimedeltaIndex(['0 days', '1 days', '2 days', '3 days', '4 days'], dtype='timedelta64[ns]', freq=None)
We can also let pandas infer the frequency when possible.
>>> pd.TimedeltaIndex(np.arange(5) * 24 * 3600 * 1e9, freq='infer') TimedeltaIndex(['0 days', '1 days', '2 days', '3 days', '4 days'], dtype='timedelta64[ns]', freq='D')
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4