summaryrefslogtreecommitdiff
path: root/doc/source/reference
diff options
context:
space:
mode:
authorhannah <story645@gmail.com>2022-10-31 19:12:48 -0400
committerGitHub <noreply@github.com>2022-10-31 16:12:48 -0700
commitf569129ff09c947f2c6d83c75cde353a38e27f64 (patch)
treea64f25a754ee0f0a32763fd35774f85a0801f817 /doc/source/reference
parent0044e2bf844156b7fd7248d7934de5c21302c5be (diff)
downloadnumpy-f569129ff09c947f2c6d83c75cde353a38e27f64.tar.gz
DOC: added example in char (#22500)
Add examples to char module docstring showing use-cases for a couple of the functions in the package. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Diffstat (limited to 'doc/source/reference')
-rw-r--r--doc/source/reference/routines.char.rst10
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/source/reference/routines.char.rst b/doc/source/reference/routines.char.rst
index 0644263f4..98ccfe802 100644
--- a/doc/source/reference/routines.char.rst
+++ b/doc/source/reference/routines.char.rst
@@ -6,8 +6,14 @@ String operations
.. module:: numpy.char
The `numpy.char` module provides a set of vectorized string
-operations for arrays of type `numpy.str_` or `numpy.bytes_`.
-All of them are based on the string methods in the Python standard library.
+operations for arrays of type `numpy.str_` or `numpy.bytes_`. For example
+
+ >>> np.char.capitalize(["python", "numpy"])
+ array(['Python', 'Numpy'], dtype='<U6')
+ >>> np.char.add(["num", "doc"], ["py", "umentation"])
+ array(['numpy', 'documentation'], dtype='<U13')
+
+The methods in this module are based on the methods in :py:mod:`String`
String operations
-----------------