DOC: add a docstring for the function 'compare_chararrays' (See #10106)#12338
DOC: add a docstring for the function 'compare_chararrays' (See #10106)#12338charris merged 4 commits intonumpy:masterfrom ryzheboka:docs-for-compare_chararrays
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.
Why not just make these 1D arrays?
There was a problem hiding this comment.
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.