Open SGeeversAtVortech opened 1 month ago
you have two choices:
pint-xarray
's versions of loc
/ sel
: yq.pint.loc[{"x": Q_(1, "s")}]
or yq.pint.sel(x=Q_(1, "s"))
pint-xarray
from main
and try out the new PintIndex
. This would mean that your code mostly just works (but I've not been able to test this as much as I would have liked, so any feedback would be appreciated)
It seems not possible to index an array with quantified coordinates; see the example below.
The line
yq.loc[Q_(1, "s")]
will raise aUnitStrippedWarning
and the lineyq.loc[Q_(1000, "ms")]
will give the same warning and then raise aKeyError
.Should one just avoid using quantified coordinates? Or are there plans to enable indexing with quantities?