A RetroSearch Logo

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

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/13078 below:

BUG/ERR: DatetimeIndex - Period shows ununderstandable error · Issue #13078 · pandas-dev/pandas · GitHub

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


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