summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-10-07 12:16:40 +0300
committerGitHub <noreply@github.com>2020-10-07 12:16:40 +0300
commit3e52634d39f3a97815c6eb609209008ea5d69816 (patch)
tree7c5437889df0746f2993c698965011353e439b96 /doc
parent291ac7f21e59440d249d0afaed3213a79cf70535 (diff)
parentdc3e276f0e777c8bc3a5b5cf76636999dde8f82e (diff)
downloadnumpy-3e52634d39f3a97815c6eb609209008ea5d69816.tar.gz
Merge pull request #17468 from eric-wieser/remove-scalar-tables
DOC: add some missing scalar aliases
Diffstat (limited to 'doc')
-rw-r--r--doc/source/reference/arrays.scalars.rst56
-rw-r--r--doc/source/user/basics.types.rst64
2 files changed, 69 insertions, 51 deletions
diff --git a/doc/source/reference/arrays.scalars.rst b/doc/source/reference/arrays.scalars.rst
index 3ab4d7301..13d117af2 100644
--- a/doc/source/reference/arrays.scalars.rst
+++ b/doc/source/reference/arrays.scalars.rst
@@ -261,10 +261,10 @@ are also provided.
.. autoclass:: numpy.bool8
-.. attribute:: numpy.int8
- numpy.int16
- numpy.int32
- numpy.int64
+.. attribute:: int8
+ int16
+ int32
+ int64
Aliases for the signed integer types (one of `numpy.byte`, `numpy.short`,
`numpy.intc`, `numpy.int_` and `numpy.longlong`) with the specified number
@@ -273,10 +273,10 @@ are also provided.
Compatible with the C99 ``int8_t``, ``int16_t``, ``int32_t``, and
``int64_t``, respectively.
-.. attribute:: numpy.uint8
- numpy.uint16
- numpy.uint32
- numpy.uint64
+.. attribute:: uint8
+ uint16
+ uint32
+ uint64
Alias for the unsigned integer types (one of `numpy.byte`, `numpy.short`,
`numpy.intc`, `numpy.int_` and `numpy.longlong`) with the specified number
@@ -285,7 +285,7 @@ are also provided.
Compatible with the C99 ``uint8_t``, ``uint16_t``, ``uint32_t``, and
``uint64_t``, respectively.
-.. attribute:: numpy.intp
+.. attribute:: intp
Alias for the signed integer type (one of `numpy.byte`, `numpy.short`,
`numpy.intc`, `numpy.int_` and `np.longlong`) that is the same size as a
@@ -295,7 +295,7 @@ are also provided.
:Character code: ``'p'``
-.. attribute:: numpy.uintp
+.. attribute:: uintp
Alias for the unsigned integer type (one of `numpy.byte`, `numpy.short`,
`numpy.intc`, `numpy.int_` and `np.longlong`) that is the same size as a
@@ -311,8 +311,8 @@ are also provided.
.. autoclass:: numpy.float64
-.. attribute:: numpy.float96
- numpy.float128
+.. attribute:: float96
+ float128
Alias for `numpy.longdouble`, named after its size in bits.
The existence of these aliases depends on the platform.
@@ -321,8 +321,8 @@ are also provided.
.. autoclass:: numpy.complex128
-.. attribute:: numpy.complex192
- numpy.complex256
+.. attribute:: complex192
+ complex256
Alias for `numpy.clongdouble`, named after its size in bits.
The existance of these aliases depends on the platform.
@@ -330,15 +330,33 @@ are also provided.
Other aliases
~~~~~~~~~~~~~
-.. autoclass:: float_
+The first two of these are conveniences which resemble the names of the
+builtin types, in the same style as `bool_`, `int_`, `str_`, `bytes_`, and
+`object_`:
-.. autoclass:: complex_
+.. autoclass:: numpy.float_
-.. autoclass:: longfloat
+.. autoclass:: numpy.complex_
-.. autoclass:: clongfloat
+Some more use alternate naming conventions for extended-precision floats and
+complex numbers:
-.. autoclass:: longcomplex
+.. autoclass:: numpy.longfloat
+
+.. autoclass:: numpy.singlecomplex
+
+.. autoclass:: numpy.cfloat
+
+.. autoclass:: numpy.longcomplex
+
+.. autoclass:: numpy.clongfloat
+
+The following aliases originate from Python 2, and it is recommended that they
+not be used in new code.
+
+.. autoclass:: numpy.string_
+
+.. autoclass:: numpy.unicode_
Attributes
==========
diff --git a/doc/source/user/basics.types.rst b/doc/source/user/basics.types.rst
index 3c39b35d0..ec2af409a 100644
--- a/doc/source/user/basics.types.rst
+++ b/doc/source/user/basics.types.rst
@@ -19,78 +19,78 @@ The primitive types supported are tied closely to those in C:
- C type
- Description
- * - `np.bool_`
+ * - `numpy.bool_`
- ``bool``
- Boolean (True or False) stored as a byte
- * - `np.byte`
+ * - `numpy.byte`
- ``signed char``
- Platform-defined
- * - `np.ubyte`
+ * - `numpy.ubyte`
- ``unsigned char``
- Platform-defined
- * - `np.short`
+ * - `numpy.short`
- ``short``
- Platform-defined
- * - `np.ushort`
+ * - `numpy.ushort`
- ``unsigned short``
- Platform-defined
- * - `np.intc`
+ * - `numpy.intc`
- ``int``
- Platform-defined
- * - `np.uintc`
+ * - `numpy.uintc`
- ``unsigned int``
- Platform-defined
- * - `np.int_`
+ * - `numpy.int_`
- ``long``
- Platform-defined
- * - `np.uint`
+ * - `numpy.uint`
- ``unsigned long``
- Platform-defined
- * - `np.longlong`
+ * - `numpy.longlong`
- ``long long``
- Platform-defined
- * - `np.ulonglong`
+ * - `numpy.ulonglong`
- ``unsigned long long``
- Platform-defined
- * - `np.half` / `np.float16`
+ * - `numpy.half` / `numpy.float16`
-
- Half precision float:
sign bit, 5 bits exponent, 10 bits mantissa
- * - `np.single`
+ * - `numpy.single`
- ``float``
- Platform-defined single precision float:
typically sign bit, 8 bits exponent, 23 bits mantissa
- * - `np.double`
+ * - `numpy.double`
- ``double``
- Platform-defined double precision float:
typically sign bit, 11 bits exponent, 52 bits mantissa.
- * - `np.longdouble`
+ * - `numpy.longdouble`
- ``long double``
- Platform-defined extended-precision float
- * - `np.csingle`
+ * - `numpy.csingle`
- ``float complex``
- Complex number, represented by two single-precision floats (real and imaginary components)
- * - `np.cdouble`
+ * - `numpy.cdouble`
- ``double complex``
- Complex number, represented by two double-precision floats (real and imaginary components).
- * - `np.clongdouble`
+ * - `numpy.clongdouble`
- ``long double complex``
- Complex number, represented by two extended-precision floats (real and imaginary components).
@@ -105,59 +105,59 @@ aliases are provided:
- C type
- Description
- * - `np.int8`
+ * - `numpy.int8`
- ``int8_t``
- Byte (-128 to 127)
- * - `np.int16`
+ * - `numpy.int16`
- ``int16_t``
- Integer (-32768 to 32767)
- * - `np.int32`
+ * - `numpy.int32`
- ``int32_t``
- Integer (-2147483648 to 2147483647)
- * - `np.int64`
+ * - `numpy.int64`
- ``int64_t``
- Integer (-9223372036854775808 to 9223372036854775807)
- * - `np.uint8`
+ * - `numpy.uint8`
- ``uint8_t``
- Unsigned integer (0 to 255)
- * - `np.uint16`
+ * - `numpy.uint16`
- ``uint16_t``
- Unsigned integer (0 to 65535)
- * - `np.uint32`
+ * - `numpy.uint32`
- ``uint32_t``
- Unsigned integer (0 to 4294967295)
- * - `np.uint64`
+ * - `numpy.uint64`
- ``uint64_t``
- Unsigned integer (0 to 18446744073709551615)
- * - `np.intp`
+ * - `numpy.intp`
- ``intptr_t``
- Integer used for indexing, typically the same as ``ssize_t``
- * - `np.uintp`
+ * - `numpy.uintp`
- ``uintptr_t``
- Integer large enough to hold a pointer
- * - `np.float32`
+ * - `numpy.float32`
- ``float``
-
- * - `np.float64` / `np.float_`
+ * - `numpy.float64` / `numpy.float_`
- ``double``
- Note that this matches the precision of the builtin python `float`.
- * - `np.complex64`
+ * - `numpy.complex64`
- ``float complex``
- Complex number, represented by two 32-bit floats (real and imaginary components)
- * - `np.complex128` / `np.complex_`
+ * - `numpy.complex128` / `numpy.complex_`
- ``double complex``
- Note that this matches the precision of the builtin python `complex`.