I use pandas DataFrame with hierarhical index, and in one particular case it is indexed by float values.
Here is example:
example_data = [
{'a': 1.2, 'b':30, 'v':123},
{'a': 1.2, 'b':60, 'v':1234},
{'a': 3, 'b':30, 'v':12345},
{'a': 3, 'b':60, 'v':123456},
]
frame = pd.DataFrame(example_data)
frame.set_index(['a', 'b'])
Now I'd like to use partial indexing to select frame with a==1.2 and then display it. Documentation shows how to do this for string index, but this approach obviously doesn't work for floats, irrevelant whether I try frame.loc[1.2] i get error about 1.2 being imporper for Int64Index which is obviously true since i use float for indexing.
Is there any way to work with float index in pandas? How can I fix my Hierarhical Index?
Actual error message was:
TypeError: the label [1.2] is not a proper indexer for this index type (Int64Index)