A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/../api/pandas.arrays.PeriodArray.html below:

pandas.arrays.PeriodArray — pandas 2.3.1 documentation

pandas.arrays.PeriodArray#
class pandas.arrays.PeriodArray(values, dtype=None, freq=None, copy=False)[source]#

Pandas ExtensionArray for storing Period data.

Users should use array() to create new instances.

Parameters:
valuesUnion[PeriodArray, Series[period], ndarray[int], PeriodIndex]

The data to store. These should be arrays that can be directly converted to ordinals without inference or copy (PeriodArray, ndarray[int64]), or a box around such an array (Series[period], PeriodIndex).

dtypePeriodDtype, optional

A PeriodDtype instance from which to extract a freq. If both freq and dtype are specified, then the frequencies must match.

freqstr or DateOffset

The freq to use for the array. Mostly applicable when values is an ndarray of integers, when freq is required. When values is a PeriodArray (or box around), it’s checked that values.freq matches freq.

copybool, default False

Whether to copy the ordinals before storing.

Attributes

Methods

See also

Period

Represents a period of time.

PeriodIndex

Immutable Index for period data.

period_range

Create a fixed-frequency PeriodArray.

array

Construct a pandas array.

Notes

There are two components to a PeriodArray

The values are physically stored as a 1-D ndarray of integers. These are called “ordinals” and represent some kind of offset from a base.

The freq indicates the span covered by each element of the array. All elements in the PeriodArray have the same freq.

Examples

>>> pd.arrays.PeriodArray(pd.PeriodIndex(['2023-01-01',
...                                       '2023-01-02'], freq='D'))
<PeriodArray>
['2023-01-01', '2023-01-02']
Length: 2, dtype: period[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