Xarray.DataSet from a list of Pandas.DataFrames

Viewed 1305

I have multiple files with bits to analyse. First i read them into a list of BitString.Bits. Then i split each file bits into the specific parts i want to see and save them into a list of Pandas.DataFrames. One DF for each file.

Now for further plotting and analysis purposes i want to store all data in one Xarray.Dataset, where i have the DataFrames stacked along the third axis with the name "dataset".

I have tried to concat each DataFrame together to an DataSet:

xr.concat(data_df[:], dim="dataset")

but i got an error saying that i cant concatenate other than DataArray or DataSets. Can i convert the DataFrames on the fly to DataArrays?

Thanks for your help!

Greetings from Germany

Jan

1 Answers
Related