I have a ORM set up in python with flyweights and underlying data stored in HDF5 files/pandas dataframes in memory. The exact mechanics aren't super important - but I'm finding that data retrieval by indexing in pandas DataFrames is quite slow. For example see the following:
For explanation FutDaily('ESA Index')._data
returns a multiindex Pandas dataframe like the following:
which is extremely fast because of the flyweight design pattern. However, I'm surprised that the indexing takes so long. Is there a faster way to pull out relevant data/slices from a Multiindex? Is it not doing some sort of dictionary lookup under the hood - in which case it should be super fast?