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/5202 below:

Period ops NaT & timedelta ops · Issue #5202 · pandas-dev/pandas · GitHub

see related #5200, #4551, #4056

seem that a direct subtraction of PeriodIndexes would accomplish this,
but don't seem to support those types of ops...

This is currently an intersection (with a '-'), but want to do a timedelta like op

In [40]: pd.PeriodIndex(start='20130101',end='20130501',freq='M').sub(
pd.PeriodIndex(start='20130201',end='20130401',freq='M'))

Partially supported actuallly

In [5]:  pd.PeriodIndex(start='20130101',end='20130501',freq='M').to_series()-pd.PeriodIndex(start='20130205',end='20130405',freq='M').to_series()
Out[5]: 
2013-01   NaN
2013-02     0
2013-03     0
2013-04     0
2013-05   NaN
Freq: M, dtype: float64

In [6]:  pd.PeriodIndex(start='20130101',end='20130201',freq='B').to_series()-pd.Period('20130101',freq='B')

TypeError: unsupported operand type(s) for -: 'int' and 'Period'

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