You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/03 22:45:58 UTC

[GitHub] [beam] TheNeuralBit edited a comment on pull request #15944: [BEAM-12563] swaplevel general function for dataframe and series

TheNeuralBit edited a comment on pull request #15944:
URL: https://github.com/apache/beam/pull/15944#issuecomment-985892212


   The PythonDocs issue is because the docstring for swaplevel is a little mangled and it breaks some of our automation:
   
   ```
   Swap levels i and j in a :class:`MultiIndex`.
   
   Default is to swap the two innermost levels of the index.
   
   Parameters
   ----------
   i, j : int or str
       Levels of the indices to be swapped. Can pass level name as string.
   axis : {0 or 'index', 1 or 'columns'}, default 0
               The axis to swap levels on. 0 or 'index' for row-wise, 1 or
               'columns' for column-wise.
   
   Returns
   -------
   DataFrame
       DataFrame with levels swapped in MultiIndex.
   
   Examples
           --------
           >>> df = pd.DataFrame(
           ...     {"Grade": ["A", "B", "A", "C"]},
           ...     index=[
           ...         ["Final exam", "Final exam", "Coursework", "Coursework"],
           ...         ["History", "Geography", "History", "Geography"],
           ...         ["January", "February", "March", "April"],
           ...     ],
           ... )
           >>> df
   ...
   ```
   
   I proposed a change upstream (https://github.com/pandas-dev/pandas/pull/44740), if that gets merged and released in 1.3.5 this issue should go away.
   
   If that takes a while or doesn't happen, we'll have to come up with some kind of workaround. I'll have to think on that. You should feel free to ignore this issue for now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org