I am using xarray to proccess a pretty long data set. It has been very much fun and I was able to find everything I needed in the online documentation. However now I try to plot data for summer and winter, and it won't work. While I found a lot of documentation on calculating means, I have not found anything on "pure" data. So my code is:
In winter:
da.loc[(dataD['time.month']>10 & dataD['time.month']<3)]
And in summer:
da.loc[(dataD['time.month']>4 & dataD['time.month']<9)]
Which should give me all the data for November to February and May to August. However I always run into the following error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I also tried slicing, like
dataH.sel(time=slice('1995-06-01', '2005-06-10'))
but I couldn't find a way to skip either the winter or summer months in between.
Btw:I want to avoid looping through the data (90k elements!). I really like the xarray (dask?!?) way to deal with data, so I'd love to keep the code clean and elegant :)
I would appreciate some help. Thanks!