Python Forum

Full Version: How to manage multiple datasets in Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

I have a question regarding how to manage multiple datasets in Python in a smart way. Let's say I have 3 .h5 file containing data I want to plot. Each one of them contains several multi dimensional arrays (u(x,y), v(x,y), w(x,y) ecc). I want to read them in an easy and smart way so that I can easily access them and plot whatever I want.

If I would use Matlab to do this job I would store them in cells so that u{1}, u{2} ans u{3} will contain the 2-D array. Now, this way is very slow and especially when the datasets are very big the computational time rises very fast.

I am new at Python but I know its potential and I am trying to figure out which is the best way to do it (maybe using objects??).
All tips are very much appreciated.
Thanks
Could you demonstrate what you're talking about with code? I don't understand what you're asking here, or why you wouldn't just use a list, or potentially a dictionary.
Thank for answering! I went looking into python dictionaries and I actually solved the problem. Thanks a lot!