Python Forum
How to manage multiple datasets in Python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to manage multiple datasets in Python (/thread-26549.html)



How to manage multiple datasets in Python - ThePhantom - May-05-2020

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


RE: How to manage multiple datasets in Python - micseydel - May-05-2020

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.


RE: How to manage multiple datasets in Python - ThePhantom - May-06-2020

Thank for answering! I went looking into python dictionaries and I actually solved the problem. Thanks a lot!