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

Missing Periods for some DateOffsets · Issue #5091 · pandas-dev/pandas · GitHub

There are not corresponding Periods for many DateOffsets.

For example see how the freq changes:

ts = pd.date_range('1/1/2012', periods=4, freq=pd.offsets.BQuarterEnd())
per = ts.to_period()
ts_per = per.to_timestamp()

In [210]: ts
Out[210]: 
<class 'pandas.tseries.index.DatetimeIndex'>
[2012-03-30 00:00:00, ..., 2012-12-31 00:00:00]
Length: 4, Freq: BQ-MAR, Timezone: None

In [211]: per
Out[211]: 
<class 'pandas.tseries.period.PeriodIndex'>
freq: Q-DEC
[2012Q1, ..., 2012Q4]
length: 4

In [212]: ts_per
Out[212]: 
<class 'pandas.tseries.index.DatetimeIndex'>
[2012-01-01 00:00:00, ..., 2012-10-01 00:00:00]
Length: 4, Freq: QS-OCT, Timezone: None

This issue is alluded to in comment: https://github.com/pydata/pandas/blob/master/pandas/tseries/frequencies.py#L329


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