You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Lauraschwarz brought to my attention that renaming keypoints/individuals could be useful in some workflows. For example they could load a dataset from file, rename things, and save it back to file.
This is possible with existing xarray functionality, but the syntax is not entirely obvious to those not familiar with xarray:
keypoint_names=ds.coords["keypoints"].values# Create new keypoints with "snout" renamed to "nose"new_keypoint_names= ["nose"ifkp=="snout"elsekpforkpinkeypoint_names]
# Assign the modified values back to the Datasetds=ds.assign_coords(keypoints=new_keypoint_names)
We could document this workflow in one of our examples.
Alternatively, we could write convenience utilities (though these would be very thin wrappers), e.g.:
I've discussed this with Laura, and we think something like this would make a good new example for our docs. Perhaps something named "Converting pose tracks between formats", which will include:
loading pose tracks from one format (e.g. SLEAP)
some data wrangling, e.g. renaming and deleting of keypoints
@Lauraschwarz brought to my attention that renaming keypoints/individuals could be useful in some workflows. For example they could load a dataset from file, rename things, and save it back to file.
This is possible with existing
xarray
functionality, but the syntax is not entirely obvious to those not familiar withxarray
:We could document this workflow in one of our examples.
Alternatively, we could write convenience utilities (though these would be very thin wrappers), e.g.:
The text was updated successfully, but these errors were encountered: