You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
b has type Series but can not be displayed, the last statement gives exception, very lengthy, the last line is "TypeError: %d format: a number is required, not numpy.ndarray". b.shape returns (2,2), which contradicts its type Series. I am guessing perhaps pandas.Series does not implement reshape function and I am calling the version from np.array. I am at pandas 0.9.1. Some discussion on stackoverflow is here http://stackoverflow.com/questions/14390224/reshape-of-pandas-series
If it does not make sense to reshape a Series, should it throw an exception?
The text was updated successfully, but these errors were encountered:
You are specifing invalid input here, I think you want (2,2) as input where you will get back an ndarray
(as a 2-d reshape is not allowed)
In [2]: a = pd.Series([1,2,3,4])
In [4]: a.reshape((2,2))
Out[4]:
array([[1, 2],
[3, 4]])
In [5]: a.reshape(2,2)
---------------------------------------------------------------------------
TypeError: must specify a tuple / singular length to reshape
It looks to me like a bug in pandas.Series.
b has type Series but can not be displayed, the last statement gives exception, very lengthy, the last line is "TypeError: %d format: a number is required, not numpy.ndarray". b.shape returns (2,2), which contradicts its type Series. I am guessing perhaps pandas.Series does not implement reshape function and I am calling the version from np.array. I am at pandas 0.9.1. Some discussion on stackoverflow is here http://stackoverflow.com/questions/14390224/reshape-of-pandas-series
If it does not make sense to reshape a Series, should it throw an exception?
The text was updated successfully, but these errors were encountered: