summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorElena Mokeeva <ryzheboka@gmail.com>2018-11-05 21:00:10 +0100
committerElena Mokeeva <ryzheboka@gmail.com>2018-11-05 21:00:10 +0100
commit96e366061e523c206990b14befce0135089260d4 (patch)
tree92e4a65b98295a11dfbafd4348e9cccb695a059c /numpy/core
parentbc8117727febce2168f21ff024286ced96b72020 (diff)
downloadnumpy-96e366061e523c206990b14befce0135089260d4.tar.gz
DOC: add a docstring for the function 'compare_chararrays'
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/_add_newdocs.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py
index ea472f1b3..6c2decd6b 100644
--- a/numpy/core/_add_newdocs.py
+++ b/numpy/core/_add_newdocs.py
@@ -1072,6 +1072,47 @@ add_newdoc('numpy.core.multiarray', 'fromstring',
""")
+add_newdoc('numpy.core.multiarray', 'compare_chararrays',
+ """
+ compare_chararrays(a, b, cmp_op, rstrip)
+
+ Preforms element-wise comparison of two string-arrays using the specified comparison operator.
+
+ Parameters
+ ----------
+ a : array_like
+ First argument.
+ b : array_like
+ Second argument.
+ cmp_op : "<" or "<=" or "==" or ">=" or ">" or "!="
+ Third argument.
+ rstrip : Boolean
+ if True, the spaces at the end of Strings are removed before the comparison
+
+ Returns
+ -------
+ out : ndarray
+ The output array of type Boolean with the same shape as a and b.
+
+ Raises
+ ------
+ ValueError
+ If cmp_op is neither "<" nor "<=" nor "==" nor ">=" nor ">" nor "!="
+
+ TypeError
+ If at least one of the arrays 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]])
+
+"""
+
+ )
+
add_newdoc('numpy.core.multiarray', 'fromiter',
"""
fromiter(iterable, dtype, count=-1)