-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
DOC: add a docstring for the function 'compare_chararrays' (See #10106) #12338
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
Conversation
I wonder why that function is public in the first place. Do you have a reason for using |
I'm actually surprised you can do the operations without that function -- the string / unicode operations often seem to require their own functions for simple operations instead of assuming that i.e., |
This is specifically for the |
numpy/core/_add_newdocs.py
Outdated
>>> a = np.array([["a"], ["b"], ["cde"]]) | ||
>>> b = np.array([["a"], ["a"], ["dec"]]) | ||
>>> np.compare_chararrays(a,b,">",True) | ||
array([[False],[True],[False]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just make these 1D arrays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I hadn't thought about that, so just changed it.
@mattip It looks like the name is outdated and misleading, it works for string arrays in general. |
Thanks @ryzheboka . |
That's my first contribution, so I feel quit unsure.