-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Unexpected NaNs in broadcast #7385
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
Comments
Now when you align these, NaNs are inserted. I would insert a |
@dopplershift does this answer fix your problem? |
@dcherian Is this behavior (filling with I can understand how xarray's data model yields this behavior, but in that case it might be good to improve the docs for |
Yes broadcasting is doing alignment with outer join by default: #6304. This is conceptually pretty confusing. I agree we should document this. |
What happened?
When running the
broadcast
in the sample code, I end up withnan
in the output when there are not any in the original source array. While I know the construction is really odd (this came from user-submitted code), I'm shocked that it resulted innan
s the resulting broadcasted data and honestly assumed MetPy's code was doing something dumb for quite awhile. I would have expected (regardless of the nature of the coordinates) that the result forbroad_a
be[[1, 2], [1, 2]]
.What did you expect to happen?
No response
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
No response
Environment
xarray: 2022.12.0
pandas: 1.5.2
numpy: 1.23.5
scipy: 1.9.3
netCDF4: 1.6.2
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.13.3
cftime: 1.6.2
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: 0.9.10.3
iris: None
bottleneck: 1.3.5
dask: 2022.6.1
distributed: 2022.6.1
matplotlib: 3.6.2
cartopy: 0.21.0
seaborn: None
numbagg: None
fsspec: 2022.11.0
cupy: None
pint: 0.20.1
sparse: None
flox: None
numpy_groupies: None
setuptools: 65.5.1
pip: 22.3.1
conda: None
pytest: 7.2.0
mypy: 0.991
IPython: 8.7.0
sphinx: 5.3.0
The text was updated successfully, but these errors were encountered: