-
Notifications
You must be signed in to change notification settings - Fork 6
implement larray_equiv and larray_nan_equiv #237
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
Labels
Milestone
Comments
Closed
Maybe more arguments to LArray.equals? See #488 |
@gdementen In which context that would be useful? |
In most contexts. Users usually do not care that axes are ordered differently when comparing two arrays. So we might want to make this the default. Also, currently, you cannot compare an array with a scalar, or to another array with less axes: >>> arr1 = ndtest(2)
>>> arr2 = full('a=a0,a1;b=b0..b2', arr1)
>>> arr2
a\b b0 b1 b2
a0 0 0 0
a1 1 1 1
>>> arr2['a0'].equals(0)
False
>>> arr2.equals(arr1)
False
>>> arr2.equals(arr2.T)
False
but...
>>> arr2 == arr1
a\b b0 b1 b2
a0 True True True
a1 True True True
>>> (arr2 == arr1).all()
True
>>> arr2 == arr2.T
a\b b0 b1 b2
a0 True True True
a1 True True True |
gdementen
added a commit
to gdementen/larray
that referenced
this issue
Sep 18, 2018
I still wonder if LArray.equiv wouldn't be better... or if check_axes=True isn't the better default value.
gdementen
added a commit
to gdementen/larray
that referenced
this issue
Sep 18, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
larray_equal is very picky (axes in same order and no broadcasting)
The text was updated successfully, but these errors were encountered: