diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2017-04-13 20:24:04 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2017-04-22 12:15:55 +0200 |
commit | 0107956102d914a68f157d80614f207f78dffb96 (patch) | |
tree | b812f602843b45ad7091db8a6377c9130b54a9e3 /doc/source/user | |
parent | 0f3846aaabc7c1278e9aeab7aafa0b8d4a1b264e (diff) | |
download | numpy-0107956102d914a68f157d80614f207f78dffb96.tar.gz |
DOC: stop refering to 'S' dtype as string
The S dtype is zero terminated bytes which happen to match what
Python 2 called strings. As this is not the case in Python 3 we should
stop naming it wrong in our documentation.
[ci skip]
Diffstat (limited to 'doc/source/user')
-rw-r--r-- | doc/source/user/basics.io.genfromtxt.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/source/user/basics.io.genfromtxt.rst b/doc/source/user/basics.io.genfromtxt.rst index 5870b5af2..1048ab725 100644 --- a/doc/source/user/basics.io.genfromtxt.rst +++ b/doc/source/user/basics.io.genfromtxt.rst @@ -96,15 +96,15 @@ This behavior can be overwritten by setting the optional argument >>> data = "1, abc , 2\n 3, xxx, 4" >>> # Without autostrip - >>> np.genfromtxt(BytesIO(data), delimiter=",", dtype="|S5") + >>> np.genfromtxt(BytesIO(data), delimiter=",", dtype="|U5") array([['1', ' abc ', ' 2'], ['3', ' xxx', ' 4']], - dtype='|S5') + dtype='|U5') >>> # With autostrip - >>> np.genfromtxt(BytesIO(data), delimiter=",", dtype="|S5", autostrip=True) + >>> np.genfromtxt(BytesIO(data), delimiter=",", dtype="|U5", autostrip=True) array([['1', 'abc', '2'], ['3', 'xxx', '4']], - dtype='|S5') + dtype='|U5') The :keyword:`comments` argument @@ -212,7 +212,7 @@ Acceptable values for this argument are: (see below). Note that ``dtype=float`` is the default for :func:`~numpy.genfromtxt`. * a sequence of types, such as ``dtype=(int, float, float)``. -* a comma-separated string, such as ``dtype="i4,f8,|S3"``. +* a comma-separated string, such as ``dtype="i4,f8,|U3"``. * a dictionary with two keys ``'names'`` and ``'formats'``. * a sequence of tuples ``(name, type)``, such as ``dtype=[('A', int), ('B', float)]``. |