Unnamed: 0 index datetime ... cVI Reg average_temp
0 0 2000-01-01 2000-01-01 ... NaN Central -5.883996
1 1 2000-01-02 2000-01-02 ... NaN Central -6.715087
2 2 2000-01-03 2000-01-03 ... NaN Central -6.074254
3 3 2000-01-04 2000-01-04 ... NaN Central -4.222387
4 4 2000-01-05 2000-01-05 ... NaN Central -0.994825
I want to convert the dataframe above to an xarray dataset, with datetime as the index. I do this:
ds = xr.Dataset.from_dataframe(df)
but I am not able to get the datetime column as index. How do I do that?
datetimeas index that can be used to, well index the dataset. Maybe you can share the expected result or elaborate?