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

Series.resample fails with how='nunique' · Issue #10914 · pandas-dev/pandas · GitHub

Works on 0.16.2, fails on git master.

import pandas as pd
import numpy as np

index = pd.date_range(start='20120102', periods=24*60*3, freq='T').values
index = index[::2]
s = pd.Series(np.arange(len(index), dtype='f8'), index=pd.Index(index))
expected = s.resample('30T', how='nunique')

Traceback:

Traceback (most recent call last):
  File "test.py", line 7, in <module>
    expected = s.resample('30T', how='nunique')
  File "/Users/jcrist/Code/pandas/pandas/core/generic.py", line 3368, in resample
    return sampler.resample(self).__finalize__(self)
  File "/Users/jcrist/Code/pandas/pandas/tseries/resample.py", line 82, in resample
    rs = self._resample_timestamps()
  File "/Users/jcrist/Code/pandas/pandas/tseries/resample.py", line 287, in _resample_timestamps
    result = grouped.aggregate(self._agg_method)
  File "/Users/jcrist/Code/pandas/pandas/core/groupby.py", line 2339, in aggregate
    return getattr(self, func_or_funcs)(*args, **kwargs)
  File "/Users/jcrist/Code/pandas/pandas/core/groupby.py", line 2564, in nunique
    sorter = np.lexsort((val, ids))
ValueError: all keys need to be the same shape

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