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
DataFrame.stack() and DataFrame.unstack() methods require docstring update.
DataFrame.stack() docstring mentions that method converts DataFrame to Series, and returns a Series. This is only the case when columns has only one level. In case columns has multiple levels, method returns a DataFrame.
DataFrame.unstack() docstring is mainly a copy of the Series.unstack() docstring, example should operate on a DataFrame and not a Series.
Concerning the behavior, when the DataFrame index is a single level one, unstack() raises:
DataFrame.unstack() assumes a DataFrame with a multilevel index, it can not operate on single level index, maybe the method could return a Series in case unstack() operates on DataFrame with single level index, similar as stack() does in case of single level columns?
The text was updated successfully, but these errors were encountered:
Noticed that issue #477 already describes fact that DataFrame.unstack() raises exception in case of single level row index, the issue does not mention documentation.
DataFrame.unstack() assumes a DataFrame with a multilevel index, it can not operate on single level index, maybe the method could return a Series in case unstack() operates on DataFrame with single level index, similar as stack() does in case of single level columns?
DataFrame.stack()
andDataFrame.unstack()
methods require docstring update.DataFrame.stack()
docstring mentions that method converts DataFrame to Series, and returns a Series. This is only the case when columns has only one level. In case columns has multiple levels, method returns a DataFrame.DataFrame.unstack()
docstring is mainly a copy of theSeries.unstack()
docstring, example should operate on a DataFrame and not a Series.Concerning the behavior, when the DataFrame index is a single level one, unstack() raises:
DataFrame.unstack()
assumes a DataFrame with a multilevel index, it can not operate on single level index, maybe the method could return a Series in case unstack() operates on DataFrame with single level index, similar as stack() does in case of single level columns?The text was updated successfully, but these errors were encountered: