Выбор даты в данных временных рядов XarrayPython

Программы на Python
Гость
Выбор даты в данных временных рядов Xarray

Сообщение Гость »


I have an xarray named wk_conc_avgs with the following structure:

xarray.DataArray'N_CT' juld: 1253 y: 850 x: 994 where juld contains dates of structure "yyyy-mm-dd"

I am trying to index a particular date by doing this:

wk_conc_avgs[juld == ('1997-05-01'),:,:] and I have also tried:

wk_conc_avgs[juld == np.datetime64('1997-05-01'),:,:] and

wk_conc_avgs.isel(juld=1997-5-1) With the first two attempts, I receive this error: "IndexError: Boolean array size 1070 is used to index array with shape (1253,)." With the latter attempt, I receive this error: "index 1991 is out of bounds for axis 0 with size 1253"

What should I try so I can index the date?

Thank you.


Источник: https://stackoverflow.com/questions/780 ... eries-data

Вернуться в «Python»