-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Groupby does not allow grouping of lat-lon pair #4732
Comments
Yes, this is a long-standing issue, #1056 What may work is to use groupby with a However, what is your use case? Because every lat/ lon pair is distinct, so it wouldn't actually do anything (it would sum over the only data value there is in each group). Unless I am missing something, which I probably do. |
Thank you @mathause , I see. My use cases would be
|
You should be able to do this without groupby. If you have a dataset with dimensions |
I close this as duplicate of #1056 - feel free to re-open if you have more questions on this. |
What happened:
xarray returns error message when grouping on latitude/longitude pairs
What you expected to happen:
Seamless execution of the groupby method providing a latitude/longitude pair
Minimal Complete Verifiable Example:
returns the following error:
if I state squeeze explicitely:
it returns the error message:
handing over an array similar to the pd notation:
returns the following error:
Describe alternatives you've considered:
I chose to use the pandas groupby method in the meantime which works with lat-lon pairs.
Environment:
xarray: 0.16.2
pandas: 1.1.5
numpy: 1.19.4
scipy: 1.5.3
netCDF4: 1.5.5.1
pydap: None
h5netcdf: None
h5py: 3.1.0
Nio: None
zarr: None
cftime: 1.3.0
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.3.2
dask: 2020.12.0
distributed: 2020.12.0
matplotlib: 3.3.3
cartopy: None
seaborn: 0.11.1
numbagg: None
pint: None
setuptools: 49.6.0.post20201009
pip: 20.3.3
conda: None
pytest: None
IPython: 7.19.0
sphinx: None
The text was updated successfully, but these errors were encountered: