xarray.DataArray.dt.dayofweek

DataArray.dt.dayofweek

The day of the week with Monday=0, Sunday=6