-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasPeriodPeriod data typePeriod data typeTimedeltaTimedelta data typeTimedelta data type
Milestone
Description
Code Sample, a copy-pastable example if possible
Split from #13071. DatetimeIndex
- Period
is not supported ATM, but errors are not understandable.
pd.DatetimeIndex(['2011-01-01', '2011-02-01']) - pd.Period('2011-01-01', freq='D')
# ValueError: Cannot do arithmetic with non-conforming periods
pd.DatetimeIndex(['2011-01-01', '2011-01-02'], freq='D') - pd.Period('2011-01-01', freq='D')
# AttributeError: 'DatetimeIndex' object has no attribute 'ordinal'
Expected Output
show understandable error message.
Or it should be supported converting Period
to Timestamp
.
pd.DatetimeIndex(['2011-01-01', '2011-02-01']) - pd.Period('2011-01-01', freq='D').to_timestamp()
# TimedeltaIndex(['0 days', '31 days'], dtype='timedelta64[ns]', freq=None)
output of pd.show_versions()
on current master
Metadata
Metadata
Assignees
Labels
BugError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasPeriodPeriod data typePeriod data typeTimedeltaTimedelta data typeTimedelta data type