I have a multi-index and I would like to convert all of its levels to float.
I'm doing the following:
my_dataframe.index.map(lambda i: (float(i[0]), float(i[1])))
However this does not seem to "scale" very well if I have many levels.
I tried this:
my_dataframe.index.astype(np.float, copy=False)
but it fails with a TypeError
:
TypeError: Setting <class 'pandas.core.indexes.multi.MultiIndex'> dtype to anything other than object is not supported
What would be the best/easiest way to achieve this?