10000 DOC: add a docstring for the function 'compare_chararrays' (See #10106) by ryzheboka · Pull Request #12338 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 4 commits into from
Nov 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
MAINT: Fix spaces, formatting, and improve explanations.
[ci skip]
  • Loading branch information
charris authored Nov 13, 2018
commit d6538309351f3138ed1d0c46eb72bc5f68134373
24 changes: 11 additions & 13 deletions numpy/core/_add_newdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,18 +1076,17 @@ def luf(lamdaexpr, *args, **kwargs):
"""
compare_chararrays(a, b, cmp_op, rstrip)

Preforms element-wise comparison of two string-arrays using the specified comparison operator.
Performs element-wise comparison of two string arrays using the
comparison operator specified by `cmp_op`.

Parameters
----------
a : array_like
First argument.
b : array_like
Second argument.
cmp_op : "<" or "<=" or "==" or ">=" or ">" or "!="
Third argument.
a, b : array_like
Arrays to be compared.
cmp_op : {"<", "<=", "==", ">=", ">", "!="}
Type of comparison.
rstrip : Boolean
if True, the spaces at the end of Strings are removed before the comparison
If True, the spaces at the end of Strings are removed before the comparison.

Returns
-------
Expand All @@ -1097,17 +1096,16 @@ def luf(lamdaexpr, *args, **kwargs):
Raises
------
ValueError
If cmp_op is neither "<" nor "<=" nor "==" nor ">=" nor ">" nor "!="

If `cmp_op` is not valid.
TypeError
If at least one of the arrays a or b is a non-string array
If at least one of `a` or `b` is a non-string array

Examples
--------
>>> a = np.array(["a", "b", "cde"])
>>> b = np.array(["a", "a", "dec"])
>>> np.compare_chararrays(a,b,">",True)
array([False,True,False])
>>> np.compare_chararrays(a, b, ">", True)
array([False, True, False])

""")

Expand Down
0