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

groupby.nth() labelling conventions changed from 0.17 -> 0.18 · Issue #13666 · pandas-dev/pandas · GitHub

In pandas 0.17.1, grouping a DatetimeIndex with monthly frequency produced labels keyed at the start of the month, and nth() produces a label keyed by the selected row. In 0.18, we unconditionally return groups labelled by the end of the month.

Old Pandas
In [25]: pd.__version__
Out[25]: u'0.17.1'

In [26]: dates = pd.date_range('2014', periods=90)

In [27]: pd.Series(index=dates).groupby(pd.TimeGrouper(freq='M')).nth(5)
Out[27]:
2014-01-06   NaN
2014-02-06   NaN
2014-03-06   NaN
dtype: float64
Latest Pandas
In [71]: pd.__version__
Out[71]: u'0.18.1'

In [72]: dates = pd.date_range('2014', periods=90)

In [73]: pd.Series(index=dates).groupby(pd.TimeGrouper(freq='M')).nth(5)
Out[73]:
2014-01-31   NaN
2014-02-28   NaN
2014-03-31   NaN
dtype: float64
Expected Output

I expect the behavior from 0.17.1.


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