pandas.Period.ordinal#

Period.ordinal#

Return the integer ordinal for this Period.

The ordinal is the internal integer representation of the Period, representing its position in the sequence of periods of the given frequency. It counts from an epoch (e.g., for daily frequency, ordinal 0 corresponds to January 1, 1970).

See also

Period.freq

Return the frequency of the Period.

Period.start_time

Return the start time of the Period.

Examples

>>> period = pd.Period('2020-01', freq='M')
>>> period.ordinal
600
>>> period = pd.Period('2020-01-01', freq='D')
>>> period.ordinal
18262