I hope this doesn't sound as an open question for discussion. I am going to give some details for my specific case.
I am new to Pandas and I need to store several 2D arrays, where columns represent frequencies and rows represent directions (2D waves spectra, if you are curious). Each array represent a specific time.
I am storing these arrays as Pandas DataFrames, but for keeping them in a single object I thought of 2 options:
Storing the DataFrames in a dictionary where the key is the time stamp.
Storing the DataFrames in a Pandas Panel where the item is the time stamp.
The first option seems simple and has the flexibility to store arrays with different sizes, indexes and column names. The second option seems better for processing the data, since Panels have specific methods, and can also be easily saved or exported (e.g. to csv or pickle).
Which of the two options is better suited in terms of: speed, memory use, flexibility and data analysis?
Regards
I don't think you need a panel. I recommend a nested dataframe approach.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With