How to create a Multi-index dataframe

  • Python
  • Thread starter msn009
  • Start date
  • Tags
    python
  • #1
53
6

Attachments

Answers and Replies

  • #2
StoneTemplePython
Science Advisor
Gold Member
2019 Award
1,145
546
I haven't gotten into the weeds of this in while, but I think what you're asking is simply not in Pandas. Pandas is designed, in effect, to be excel spreadsheets via python (with the added capabilities that come with it).

Spreadsheets are fundamentally indexed with (i,j) pairs. There is no third index. (You could try to synthetically creating such a thing via a mapping formula that you come up with though that sounds unpleasant).

If you want to use (i,j,k) indexing, this is 3-D tensor territory that is easy to manipulate via arrays in Numpy. It is not Pandas.
 

Related Threads on How to create a Multi-index dataframe

Replies
5
Views
473
  • Last Post
Replies
9
Views
17K
Replies
8
Views
766
Replies
5
Views
135
Replies
15
Views
729
Replies
2
Views
20K
Replies
1
Views
522
Replies
5
Views
2K
Replies
4
Views
925
Replies
9
Views
15K
Top