psychopy_ext.stats.reorder — psychopy_ext 0.5.4 documentation
Author: Jonas Kubilius
Description: A framework for a rapid reproducible design, analysis and plotting of experiments in neuroscience and psychology

# psychopy_ext.stats.reorder

`psychopy_ext.stats.` `reorder`(agg, order, level=None, dim='columns')

  Reorders rows or columns in a pandas.DataFrame.

  It relies on for loops, so it will be slow for large data frames.

  Args: | agg (pandas.DataFrame) Your (usually aggregated) data order (list or dict) Order of entries. A list is only accepted is level is given. Otherwise, order should be a dict with level names (str) as keys and a list of order in values.
  Kwargs: | level (str, default: None) Which level needs to be reordered. Levels must be str. dim (str, {‘rows’, ‘index’, ‘columns’}, default: ‘columns’) Whether to reorder rows (or index) or columns.
  Returns: | Reordered pandas.DataFrame