Closed
Description
When we pass a list of numbers, it parsed as date as it is. The same values is regarded as ordinal
if it is passed as an array.
Code Sample, a copy-pastable example if possible
raw = [2005, 2007, 2009]
pd.PeriodIndex(raw, freq='A')
# PeriodIndex(['2005', '2007', '2009'], dtype='period[A-DEC]', freq='A-DEC')
pd.PeriodIndex(np.array(raw), freq='A')
# PeriodIndex(['3975', '3977', '3979'], dtype='period[A-DEC]', freq='A-DEC')
Expected Output
Because PeriodIndex
has a data
and ordinal
arg, it should be regarded as:
- date if it is passed via
data
kwd ordinal
if it is passed viaordinal
kwd
output of pd.show_versions()
on current master.