Skip to content
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

Dot product behavior in xarray differs from numpy #28

Open
pmk-LANL opened this issue Mar 17, 2021 · 0 comments
Open

Dot product behavior in xarray differs from numpy #28

pmk-LANL opened this issue Mar 17, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@pmk-LANL
Copy link
Collaborator

This is relevant to substituting xarray for certain multi-dimensional array operations instead of using numpy arrays with for-loops. Apparently dot product behavior of xarray is different from that of numpy.

detArrInv.dot(signalsy0), where signalsy0 is a 1D numpy array, returns a different result depending on if detArrInv is a 2D numpy.ndarray or a xarray.DataArray.
However, np.dot(detArrInv, signalsy0) returns the same result.
I found this while transitioning to xarray, it caused a lot of headache. Will look into this further, but on first pass of the documentation I can't find any indication that there should be a difference when dotting 1D arrays.

@pmk-LANL pmk-LANL added bug Something isn't working enhancement New feature or request labels Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant