xarray DataArray output -- grouping by spatial bins #203
Unanswered
frazermi268
asked this question in
Q&A
Replies: 1 comment
-
This indeed seem to be outside of the use case for import itertools as itt
agg_ls = []
for binx, biny in itt.product(pd.cut(S.coords['x']), pd.cut(S.coords['y'])):
agg_ls = S.sel(x=slice(*binx), y=slice(*biny)) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I just started using minian recently, and am having a bit of trouble understanding the structure of the dataset. I was wondering if anyone had advice for working with the minian data set output in 2D space. Specifically, I am trying to find place cells in an open field, and I want to bin the calcium event data (S) into ~2.5 cm square bins that cover the area. While doing this with a linear track makes sense, through using the grouby_bins functionality, I haven't been able to find a way to groupby_bins across both X and Y values, and it seems like the groupby functions for xr.DataSets only work for 1 dimension at a time.
Does anyone know whether there is a workaround for this? Or is this something that requires the data to be moved outside of the xr.DataArray format?
Thank you so much in advance!!
Michelle
Beta Was this translation helpful? Give feedback.
All reactions