Difference between various xarray methods #5908
Replies: 1 comment 1 reply
-
Hi @PythonSchlumpf , sorry to hear that in this case the documentation didn't answer your questions.
Are you comfortable with the idea that xarray provides multiple data objects you can use? Specifically a The difference between
You can open each file separately and combine them later (see the docs on combining xarray objects), but if your hdf5 files are related you likely want to open multiple files in one go, which is what
You can open them all in one go with I recommend you start by opening them one-by-one (so open each one with 1000 is quite a lot of files though - depending on how large they are you might find that you would get more performance by having a smaller number of larger files (which you could create using P.S. If you have any ideas for how you think the docs on this could be improved then we're all ears! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am a newbie with respect to xarray and I am looking for some help, exchange, guidance.
What is the difference between
xr.open_mfdataset
,xr.open_dataarray
,xr.open_dataset
, please?I have not understand the difference.
Edit: Looks like
xr.open_mfdataset
can open multiple files,xr.open_dataset
only one, but alsoxr.open_dataarray
opens somehow one.I tried to apply
xr.open_mfdataset
to my list of files, but I failed. They don't have dimensions or coordinates per se.I have multiple hdf5 files ('.h5', created with h5py), each of them has multi-dim numpy arrays in them with a description of attributes. Example: a stack of 10 2d numpy arrays with low_idx=0, high=idx=9, another stack of 10 2d numpy arrays with low_idx=10, high=idx=19 etc, last file: 1 2d numpy array with low_idx=20, high_idx=20.
How could I go through 1000 hdf5 files, extract the numpy arrays, put them together in one location, and maybe have a dimension idx running from 0 to 9999?
Should I opt for xarray dataset, because I want to combine multiple information from other sources with it?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions