1

Are there any libraries with data tables that allow you to define multiple levels of column names the way you can in pandas with MultiIndex?

It seems like there is no equivalent in R, Julia, dask, polars, etc. Is pandas the only package that does this?

For example this table below has 2 levels of column headers, which doesn't seem possible to directly represent in most other packages and would have to be unstacked.

enter image description here

pyjamas
  • 4,608
  • 5
  • 38
  • 70
  • 2
    Databases typically have composite indexes, which are the same thing. – tdelaney Feb 11 '23 at 18:14
  • 1
    In pandas MultiIndex can be used to represent multiple levels of keys both on the rows and the columns. I think SQL composite indexes are similar to a pandas MultiIndex on rows but doesn't apply for columns and am still curious about equivalents for that. I edited my post with an example if it's not clear what I mean – pyjamas Feb 11 '23 at 18:43
  • Because you can essentially stack a multilevel-column into a multilevel-index data, so most other libraries don't implement that? – Quang Hoang Feb 11 '23 at 21:48

0 Answers0