Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c09d8dc

Browse files
committed
genfromtxt example in user docs missing delimiter
The example given in the user docs does not run correctly without adding `delimiter=","`. This add the missing keyword to allow the examples to be run.
1 parent 75eeb75 commit c09d8dc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

doc/source/user/basics.io.genfromtxt.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ This behavior can be overwritten by setting the optional argument
9494

9595
>>> data = "1, abc , 2\n 3, xxx, 4"
9696
>>> # Without autostrip
97-
>>> np.genfromtxt(StringIO(data), dtype="|S5")
97+
>>> np.genfromtxt(StringIO(data), delimiter=",", dtype="|S5")
9898
array([['1', ' abc ', ' 2'],
9999
['3', ' xxx', ' 4']],
100100
dtype='|S5')
101101
>>> # With autostrip
102-
>>> np.genfromtxt(StringIO(data), dtype="|S5", autostrip=True)
102+
>>> np.genfromtxt(StringIO(data), delimiter=",", dtype="|S5", autostrip=True)
103103
array([['1', 'abc', '2'],
104104
['3', 'xxx', '4']],
105105
dtype='|S5')

0 commit comments

Comments
 (0)