API: Reshaping Series to its own shape raises TypeError · Issue #4554 · pandas-dev/pandas (original) (raw)
This may be seen like a weird function call but it is actually triggered when plotting with development versions of matplotlib and the case is explicitly (and wrongly as it seems) by pandas:
>>> import pandas as pd
>>> x = pd.Series(range(5))
>>> x.reshape(x.shape)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/pandas/core/series.py", line 981, in reshape
return ndarray.reshape(self, newshape, order)
TypeError: an integer is required
It is easily fixed just replacing the offending line by this one:
return ndarray.reshape(self, newshape, order=order)