Based on the error message, it seems that numpy 1.11.0the rounding function looks like this:
try:
round = a.round
except AttributeError:
return _wrapit(a, 'round', decimals, out)
return round(decimals, out)
It looks like it pandas.Series.roundtakes only two arguments ( self, precision), but numpypasses it an additional argument out. Presumably this is either a bug or a change to the API in pandasor numpy.
, . - Series.round():
sp500['42d'] = pd.rolling_mean(sp500['Close'], window=42).round(2)
- numpy.round numpy:
sp500['42d'] = np.round(pd.rolling_mean(sp500['Close'], window=42).values, 2)
. , . . pandas github tracker, # 12644.