Skip to content

Commit 03e7218

Browse files
authored
Merge pull request numpy#27448 from yashasvimisra2798/yashi
DOC: Example for char.array
2 parents 83bf225 + 4519a95 commit 03e7218

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

numpy/_core/defchararray.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,15 @@ class adds the following functionality:
12691269
fastest). If order is 'A', then the returned array may
12701270
be in any order (either C-, Fortran-contiguous, or even
12711271
discontiguous).
1272+
1273+
Examples
1274+
--------
1275+
1276+
>>> import numpy as np
1277+
>>> char_array = np.char.array(['hello', 'world', 'numpy','array'])
1278+
>>> char_array
1279+
chararray(['hello', 'world', 'numpy', 'array'], dtype='<U5')
1280+
12721281
"""
12731282
if isinstance(obj, (bytes, str)):
12741283
if unicode is None:

0 commit comments

Comments
 (0)