summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/source/reference/arrays.dtypes.rst12
-rw-r--r--doc/source/reference/c-api.types-and-structures.rst4
-rw-r--r--numpy/add_newdocs.py14
-rw-r--r--numpy/lib/polynomial.py2
4 files changed, 24 insertions, 8 deletions
diff --git a/doc/source/reference/arrays.dtypes.rst b/doc/source/reference/arrays.dtypes.rst
index 2fc1add99..797f1f6f8 100644
--- a/doc/source/reference/arrays.dtypes.rst
+++ b/doc/source/reference/arrays.dtypes.rst
@@ -220,16 +220,20 @@ One-character strings
Array-protocol type strings (see :ref:`arrays.interface`)
The first character specifies the kind of data and the remaining
- characters specify how many bytes of data. The supported kinds are
+ characters specify the number of bytes per item. The item size may
+ be ignored for some kinds (i.e., boolean, object), rounded to the
+ next supported size (float, complex), or interpreted as the number
+ of characters (Unicode). The supported kinds are
================ ========================
- ``'b'`` Boolean
+ ``'b'`` boolean
``'i'`` (signed) integer
``'u'`` unsigned integer
``'f'`` floating-point
``'c'`` complex-floating point
- ``'S'``, ``'a'`` string
- ``'U'`` unicode
+ ``'O'`` (Python) objects
+ ``'S'``, ``'a'`` (byte-)string
+ ``'U'`` Unicode
``'V'`` raw data (:class:`void`)
================ ========================
diff --git a/doc/source/reference/c-api.types-and-structures.rst b/doc/source/reference/c-api.types-and-structures.rst
index d26ed56cb..f1e216a5c 100644
--- a/doc/source/reference/c-api.types-and-structures.rst
+++ b/doc/source/reference/c-api.types-and-structures.rst
@@ -1119,8 +1119,8 @@ PyArrayInterface
A character indicating what kind of array is present according to the
typestring convention with 't' -> bitfield, 'b' -> Boolean, 'i' ->
signed integer, 'u' -> unsigned integer, 'f' -> floating point, 'c' ->
- complex floating point, 'O' -> object, 'S' -> string, 'U' -> unicode,
- 'V' -> void.
+ complex floating point, 'O' -> object, 'S' -> (byte-)string, 'U' ->
+ unicode, 'V' -> void.
.. cmember:: int PyArrayInterface.itemsize
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 23faa3290..86ea4b8b6 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -6118,7 +6118,19 @@ add_newdoc('numpy.core.multiarray', 'dtype', ('itemsize',
add_newdoc('numpy.core.multiarray', 'dtype', ('kind',
"""
- A character code (one of 'biufcSUV') identifying the general kind of data.
+ A character code (one of 'biufcOSUV') identifying the general kind of data.
+
+ = ======================
+ b boolean
+ i signed integer
+ u unsigned integer
+ f floating-point
+ c complex floating-point
+ O object
+ S (byte-)string
+ U Unicode
+ V void
+ = ======================
"""))
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index 8545375cd..3d9b213c8 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -127,7 +127,7 @@ def poly(seq_of_zeros):
elif len(sh) == 1:
pass
else:
- raise ValueError("input must be 1d or square 2d array.")
+ raise ValueError("input must be 1d or non-empty square 2d array.")
if len(seq_of_zeros) == 0:
return 1.0