diff options
Diffstat (limited to 'doc/source/reference')
-rw-r--r-- | doc/source/reference/arrays.classes.rst | 11 | ||||
-rw-r--r-- | doc/source/reference/routines.array-creation.rst | 1 | ||||
-rw-r--r-- | doc/source/reference/routines.char.rst | 88 | ||||
-rw-r--r-- | doc/source/reference/routines.rst | 1 |
4 files changed, 96 insertions, 5 deletions
diff --git a/doc/source/reference/arrays.classes.rst b/doc/source/reference/arrays.classes.rst index 9e94d5c4d..6d5e7bde0 100644 --- a/doc/source/reference/arrays.classes.rst +++ b/doc/source/reference/arrays.classes.rst @@ -228,11 +228,12 @@ Character arrays (:mod:`numpy.char`) single: character arrays .. note:: - The chararray module exists for backwards compatibility with Numarray, - it is not recommended for new development. If one needs arrays of - strings, use arrays of `dtype` object. + The chararray module exists for backwards compatibility with + Numarray, it is not recommended for new development. If one needs + arrays of strings, use arrays of `dtype` `object_`, `string_` or + `unicode_`. -These are enhanced arrays of either :class:`string` type or +These are enhanced arrays of either :class:`string_` type or :class:`unicode_` type. These arrays inherit from the :class:`ndarray`, but specially-define the operations ``+``, ``*``, and ``%`` on a (broadcasting) element-by-element basis. These @@ -244,7 +245,7 @@ to create a chararray is to use :meth:`self.view(chararray) <ndarray.view>` where *self* is an ndarray of string or unicode data-type. However, a chararray can also be created using the :meth:`numpy.chararray` constructor, or via the -:func:`numpy.char.array` function: +:func:`numpy.char.array <core.defchararray.array>` function: .. autosummary:: :toctree: generated/ diff --git a/doc/source/reference/routines.array-creation.rst b/doc/source/reference/routines.array-creation.rst index 4eabb8ec7..ef9c0041d 100644 --- a/doc/source/reference/routines.array-creation.rst +++ b/doc/source/reference/routines.array-creation.rst @@ -66,6 +66,7 @@ Creating character arrays (:mod:`numpy.char`) :toctree: generated/ core.defchararray.array + core.defchararray.asarray Numerical ranges ---------------- diff --git a/doc/source/reference/routines.char.rst b/doc/source/reference/routines.char.rst new file mode 100644 index 000000000..2e995a772 --- /dev/null +++ b/doc/source/reference/routines.char.rst @@ -0,0 +1,88 @@ +String operations +***************** + +.. currentmodule:: numpy.core.defchararray + +This module provides a set of vectorized string operations for arrays +of type `numpy.string_` or `numpy.unicode_`. All of them are based on +the string methods in the Python standard library. + +String operations +----------------- + +.. autosummary:: + :toctree: generated/ + + add + multiply + mod + capitalize + center + decode + encode + join + ljust + lower + lstrip + partition + replace + rjust + rpartition + rsplit + rstrip + split + splitlines + strip + swapcase + title + translate + upper + zfill + +Comparison +---------- + +Unlike the standard numpy comparison operators, the ones in the `char` +module strip trailing whitespace characters before performing the +comparison. + +.. autosummary:: + :toctree: generated/ + + equal + not_equal + greater_equal + less_equal + greater + less + +String information +------------------ + +.. autosummary:: + :toctree: generated/ + + count + len + find + index + isalpha + isdecimal + isdigit + islower + isnumeric + isspace + istitle + isupper + rfind + rindex + startswith + +Convenience class +----------------- + +.. autosummary:: + :toctree: generated/ + + chararray + diff --git a/doc/source/reference/routines.rst b/doc/source/reference/routines.rst index eb2e9fc4e..90fe1c189 100644 --- a/doc/source/reference/routines.rst +++ b/doc/source/reference/routines.rst @@ -34,3 +34,4 @@ Routines routines.numarray routines.oldnumeric routines.ctypeslib + routines.char |