pandas-dev/pandas (original) (raw)
This is a regression since July 12.
import pandas
import numpy as np
pandas.rolling_max(np.arange(3), 100, min_periods=1)
pandas.rolling_min(np.arange(3), 100, min_periods=1)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-4-782732058ee9> in <module>()
----> 1 pandas.rolling_max(np.arange(3), 100, min_periods=1)
/Library/Python/2.7/site-packages/pandas-0.9.0.dev_1e1c922-py2.7-macosx-10.8-intel.egg/pandas/stats/moments.pyc in f(arg, window, min_periods, freq, time_rule, **kwargs)
436 return func(arg, window, minp, **kwds)
437 return _rolling_moment(arg, window, call_cython, min_periods,
--> 438 freq=freq, time_rule=time_rule, **kwargs)
439
440 return f
/Library/Python/2.7/site-packages/pandas-0.9.0.dev_1e1c922-py2.7-macosx-10.8-intel.egg/pandas/stats/moments.pyc in _rolling_moment(arg, window, func, minp, axis, freq, time_rule, **kwargs)
252 return_hook, values = _process_data_structure(arg)
253 # actually calculate the moment. Faster way to do this?
--> 254 result = np.apply_along_axis(calc, axis, values)
255
256 return return_hook(result)
/Library/Python/2.7/site-packages/numpy-1.6.2-py2.7-macosx-10.8-intel.egg/numpy/lib/shape_base.pyc in apply_along_axis(func1d, axis, arr, *args)
78 outshape = asarray(arr.shape).take(indlist)
79 i.put(indlist, ind)
---> 80 res = func1d(arr[tuple(i.tolist())],*args)
81 # if res is a number, then we have a smaller output array
82 if isscalar(res):
/Library/Python/2.7/site-packages/pandas-0.9.0.dev_1e1c922-py2.7-macosx-10.8-intel.egg/pandas/stats/moments.pyc in <lambda>(x)
249 """
250 arg = _conv_timerule(arg, freq, time_rule)
--> 251 calc = lambda x: func(x, window, minp=minp, **kwargs)
252 return_hook, values = _process_data_structure(arg)
253 # actually calculate the moment. Faster way to do this?
/Library/Python/2.7/site-packages/pandas-0.9.0.dev_1e1c922-py2.7-macosx-10.8-intel.egg/pandas/stats/moments.pyc in call_cython(arg, window, minp, **kwds)
434 def call_cython(arg, window, minp, **kwds):
435 minp = check_minp(minp, window)
--> 436 return func(arg, window, minp, **kwds)
437 return _rolling_moment(arg, window, call_cython, min_periods,
438 freq=freq, time_rule=time_rule, **kwargs)
/Library/Python/2.7/site-packages/pandas-0.9.0.dev_1e1c922-py2.7-macosx-10.8-intel.egg/pandas/lib.so in pandas.lib.roll_max2 (pandas/src/tseries.c:78735)()
ValueError: Invalid window size 100 for len 3 array