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

nunique + TimeGrouper error · Issue #12352 · pandas-dev/pandas · GitHub

This used to work in the past:

tmp = pd.DataFrame({
        'ID': {pd.Timestamp('2015-06-05 00:00:00'): '0010100903', pd.Timestamp('2015-06-08 00:00:00'): '0010150847'},
        'DATE': {pd.Timestamp('2015-06-05 00:00:00'): '2015-06-05', pd.Timestamp('2015-06-08 00:00:00'): '2015-06-08'}})
tmp.groupby(pd.TimeGrouper('D')).ID.nunique()

but now I get the obscure:

Traceback (most recent call last):
  File "test.py", line 6, in <module>
    tmp.groupby(pd.TimeGrouper('D')).ID.nunique()
  File "/usr/lib/python3/dist-packages/pandas/core/groupby.py", line 2697, in nunique
    name=self.name)
  File "/usr/lib/python3/dist-packages/pandas/core/series.py", line 227, in __init__
    data = SingleBlockManager(data, index, fastpath=True)
  File "/usr/lib/python3/dist-packages/pandas/core/internals.py", line 3736, in __init__
    ndim=1, fastpath=True)
  File "/usr/lib/python3/dist-packages/pandas/core/internals.py", line 2454, in make_block
    placement=placement)
  File "/usr/lib/python3/dist-packages/pandas/core/internals.py", line 87, in __init__
    len(self.values), len(self.mgr_locs)))
ValueError: Wrong number of items passed 2, placement implies 4

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