How do you select a column from an xarray.DataArray please? This is how I am doing the xarray
import xarray as xr
import numpy as np
import pandas as pd
my_data = np.random.rand(5,2)
da = xr.DataArray(my_data,
coords={'my_id':np.arange(my_data.shape[0]),
'columns': ['x', 'y']},
dims=['my_id', 'columns'])
and I want to select column x. If that was a dataframe
df = pd.DataFrame(my_data, columns=['x','y'])
i am looking for the equivalent of df['x']
Am I defining the DataArray the wrong way?