Skip to content

Commit 5eefd39

Browse files
DOC: Example for char.array
1 parent fa212eb commit 5eefd39

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

numpy/_core/defchararray.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,6 @@ class adds the following functionality:
526526
Examples
527527
--------
528528
529-
>>> import numpy as np
530-
>>> char_array = np.char.array(['hello', 'world', 'numpy','array'])
531-
532-
>>> char_array
533-
chararray(['hello', 'world', 'numpy', 'array'], dtype='<U5')
534-
535-
536529
>>> import numpy as np
537530
>>> charar = np.char.chararray((3, 3))
538531
>>> charar[:] = 'a'
@@ -1278,6 +1271,16 @@ class adds the following functionality:
12781271
fastest). If order is 'A', then the returned array may
12791272
be in any order (either C-, Fortran-contiguous, or even
12801273
discontiguous).
1274+
1275+
Examples
1276+
--------
1277+
1278+
>>> import numpy as np
1279+
>>> char_array = np.char.array(['hello', 'world', 'numpy','array'])
1280+
1281+
>>> char_array
1282+
chararray(['hello', 'world', 'numpy', 'array'], dtype='<U5')
1283+
12811284
"""
12821285
if isinstance(obj, (bytes, str)):
12831286
if unicode is None:

0 commit comments

Comments
 (0)