pandas: BUG: tuple as index not possible anymore in pandas 0.14?

I used to do convert a dict with tuple keys to DataFrame like

DataFrame.from_dict(a_dict, 'index')

but it produces “IndexError: index out of bounds” from pandas 0.14. Is there a way that I still can use tuple as Dataframe label? My old codes do not work with 0.14.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

One case where you might want to use tuples for labels and NOT use a multiindex is when the tuples are various lengths. I guess it may be possible to use a multiindex even in this case (with nan/null filling the empty positions for the shorter tuples) but it just seems more natural to have the tuples in a regular (non-multi) index.