tritemio / pybroom

pybroom, the python's broom to tidy up messy fit results!
http://pybroom.readthedocs.io/
MIT License
14 stars 5 forks source link

Option to use categorical columns as index #2

Closed tritemio closed 8 years ago

tritemio commented 8 years ago

Add option to put the categorical columns in the DataFrame index (or MultiIndex).

In this way stack and unstack operations will work naturally.

tritemio commented 8 years ago

I'll not include this option in pybroom for now. This is easy enough in pandas and user needing it will know how to build the index.

I will only add an example in the notebooks showing how turn categorical columns into a MultiIndex.

If the categorical axis are ('dataset', 'loss') the multi-index version can be created with:

dg.set_index(['dataset', 'loss']).sort_index()