I'm curious about these two aspects of pandas:

1. Objects (tuples, booleans, numbers) as column names
2. Heavy emphasis on row indices

I can imagine some use cases for these but they seem like edge cases. Who finds these especially useful? I assume it's someone.

Or perhaps they're also useful for me but I just don't get it.

I can imagine using tuple column names if I needed to loop through columns in some very precise way, but trying to remember when I've needed that. Boolean column names though? No idea.

Show thread

Row indices have, as of yet, exclusively existed to annoy me until I do .reset_index() every three lines. I suspect this may be mostly a use case difference and data science types really value this, given how many explainers I see talk about the huge power of multi-index DFs.

Show thread

@nickchk it's not too often, but I do run into cases where multi-indexing is helpful

Mostly it can be helpful for keeping repeated observation data, where I can put the dual ID columns 'outside' of the data set.

Another use-case is generating complex table 1's to be directly output to Excel

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.