diff options
author | mattip <matti.picus@gmail.com> | 2018-04-17 13:46:36 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2018-04-17 16:54:10 +0300 |
commit | df8e83538461c29bc12c44198574bde8ffefcad7 (patch) | |
tree | d16f3b97dfa068fce3f081bdcd6a7c94240bb426 /numpy/core | |
parent | 8323be1bc44c2811fc36f5b99c1a30ebcee8edbd (diff) | |
download | numpy-df8e83538461c29bc12c44198574bde8ffefcad7.tar.gz |
DOC: clear up warnings, fix matplotlib plot
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/arrayprint.py | 164 | ||||
-rw-r--r-- | numpy/core/code_generators/ufunc_docstrings.py | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/scalartypes.c.src | 3 |
3 files changed, 88 insertions, 83 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index 7dc73d6de..ad0f630ba 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -132,44 +132,45 @@ def set_printoptions(precision=None, threshold=None, edgeitems=None, formatting function applies to. Callables should return a string. Types that are not specified (by their corresponding keys) are handled by the default formatters. Individual types for which a formatter - can be set are:: - - - 'bool' - - 'int' - - 'timedelta' : a `numpy.timedelta64` - - 'datetime' : a `numpy.datetime64` - - 'float' - - 'longfloat' : 128-bit floats - - 'complexfloat' - - 'longcomplexfloat' : composed of two 128-bit floats - - 'numpystr' : types `numpy.string_` and `numpy.unicode_` - - 'object' : `np.object_` arrays - - 'str' : all other strings - - Other keys that can be used to set a group of types at once are:: - - - 'all' : sets all types - - 'int_kind' : sets 'int' - - 'float_kind' : sets 'float' and 'longfloat' - - 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat' - - 'str_kind' : sets 'str' and 'numpystr' + can be set are: + + - 'bool' + - 'int' + - 'timedelta' : a `numpy.timedelta64` + - 'datetime' : a `numpy.datetime64` + - 'float' + - 'longfloat' : 128-bit floats + - 'complexfloat' + - 'longcomplexfloat' : composed of two 128-bit floats + - 'numpystr' : types `numpy.string_` and `numpy.unicode_` + - 'object' : `np.object_` arrays + - 'str' : all other strings + + Other keys that can be used to set a group of types at once are: + + - 'all' : sets all types + - 'int_kind' : sets 'int' + - 'float_kind' : sets 'float' and 'longfloat' + - 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat' + - 'str_kind' : sets 'str' and 'numpystr' floatmode : str, optional Controls the interpretation of the `precision` option for floating-point types. Can take the following values: - - 'fixed' : Always print exactly `precision` fractional digits, - even if this would print more or fewer digits than - necessary to specify the value uniquely. - - 'unique : Print the minimum number of fractional digits necessary - to represent each value uniquely. Different elements may - have a different number of digits. The value of the - `precision` option is ignored. - - 'maxprec' : Print at most `precision` fractional digits, but if - an element can be uniquely represented with fewer digits - only print it with that many. - - 'maxprec_equal' : Print at most `precision` fractional digits, - but if every element in the array can be uniquely - represented with an equal number of fewer digits, use that - many digits for all elements. + + * 'fixed': Always print exactly `precision` fractional digits, + even if this would print more or fewer digits than + necessary to specify the value uniquely. + * 'unique': Print the minimum number of fractional digits necessary + to represent each value uniquely. Different elements may + have a different number of digits. The value of the + `precision` option is ignored. + * 'maxprec': Print at most `precision` fractional digits, but if + an element can be uniquely represented with fewer digits + only print it with that many. + * 'maxprec_equal': Print at most `precision` fractional digits, + but if every element in the array can be uniquely + represented with an equal number of fewer digits, use that + many digits for all elements. legacy : string or `False`, optional If set to the string `'1.13'` enables 1.13 legacy printing mode. This approximates numpy 1.13 print output by including a space in the sign @@ -536,27 +537,27 @@ def array2string(a, max_line_width=None, precision=None, formatting function applies to. Callables should return a string. Types that are not specified (by their corresponding keys) are handled by the default formatters. Individual types for which a formatter - can be set are:: - - - 'bool' - - 'int' - - 'timedelta' : a `numpy.timedelta64` - - 'datetime' : a `numpy.datetime64` - - 'float' - - 'longfloat' : 128-bit floats - - 'complexfloat' - - 'longcomplexfloat' : composed of two 128-bit floats - - 'void' : type `numpy.void` - - 'numpystr' : types `numpy.string_` and `numpy.unicode_` - - 'str' : all other strings - - Other keys that can be used to set a group of types at once are:: - - - 'all' : sets all types - - 'int_kind' : sets 'int' - - 'float_kind' : sets 'float' and 'longfloat' - - 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat' - - 'str_kind' : sets 'str' and 'numpystr' + can be set are: + + - 'bool' + - 'int' + - 'timedelta' : a `numpy.timedelta64` + - 'datetime' : a `numpy.datetime64` + - 'float' + - 'longfloat' : 128-bit floats + - 'complexfloat' + - 'longcomplexfloat' : composed of two 128-bit floats + - 'void' : type `numpy.void` + - 'numpystr' : types `numpy.string_` and `numpy.unicode_` + - 'str' : all other strings + + Other keys that can be used to set a group of types at once are: + + - 'all' : sets all types + - 'int_kind' : sets 'int' + - 'float_kind' : sets 'float' and 'longfloat' + - 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat' + - 'str_kind' : sets 'str' and 'numpystr' threshold : int, optional Total number of array elements which trigger summarization rather than full repr. @@ -571,20 +572,21 @@ def array2string(a, max_line_width=None, precision=None, floatmode : str, optional Controls the interpretation of the `precision` option for floating-point types. Can take the following values: - - 'fixed' : Always print exactly `precision` fractional digits, - even if this would print more or fewer digits than - necessary to specify the value uniquely. - - 'unique : Print the minimum number of fractional digits necessary - to represent each value uniquely. Different elements may - have a different number of digits. The value of the - `precision` option is ignored. - - 'maxprec' : Print at most `precision` fractional digits, but if - an element can be uniquely represented with fewer digits - only print it with that many. - - 'maxprec_equal' : Print at most `precision` fractional digits, - but if every element in the array can be uniquely - represented with an equal number of fewer digits, use that - many digits for all elements. + + - 'fixed': Always print exactly `precision` fractional digits, + even if this would print more or fewer digits than + necessary to specify the value uniquely. + - 'unique': Print the minimum number of fractional digits necessary + to represent each value uniquely. Different elements may + have a different number of digits. The value of the + `precision` option is ignored. + - 'maxprec': Print at most `precision` fractional digits, but if + an element can be uniquely represented with fewer digits + only print it with that many. + - 'maxprec_equal': Print at most `precision` fractional digits, + but if every element in the array can be uniquely + represented with an equal number of fewer digits, use that + many digits for all elements. legacy : string or `False`, optional If set to the string `'1.13'` enables 1.13 legacy printing mode. This approximates numpy 1.13 print output by including a space in the sign @@ -984,11 +986,12 @@ def format_float_scientific(x, precision=None, unique=True, trim='k', value. trim : one of 'k', '.', '0', '-', optional Controls post-processing trimming of trailing digits, as follows: - k : keep trailing zeros, keep decimal point (no trimming) - . : trim all trailing zeros, leave decimal point - 0 : trim all but the zero before the decimal point. Insert the - zero if it is missing. - - : trim trailing zeros and any trailing decimal point + + * 'k' : keep trailing zeros, keep decimal point (no trimming) + * '.' : trim all trailing zeros, leave decimal point + * '0' : trim all but the zero before the decimal point. Insert the + zero if it is missing. + * '-' : trim trailing zeros and any trailing decimal point sign : boolean, optional Whether to show the sign for positive values. pad_left : non-negative integer, optional @@ -1056,11 +1059,12 @@ def format_float_positional(x, precision=None, unique=True, digits, before or after the decimal point, ignoring leading zeros. trim : one of 'k', '.', '0', '-', optional Controls post-processing trimming of trailing digits, as follows: - k : keep trailing zeros, keep decimal point (no trimming) - . : trim all trailing zeros, leave decimal point - 0 : trim all but the zero before the decimal point. Insert the - zero if it is missing. - - : trim trailing zeros and any trailing decimal point + + 'k' : keep trailing zeros, keep decimal point (no trimming) + '.' : trim all trailing zeros, leave decimal point + '0' : trim all but the zero before the decimal point. Insert the + zero if it is missing. + '-' : trim trailing zeros and any trailing decimal point sign : boolean, optional Whether to show the sign for positive values. pad_left : non-negative integer, optional diff --git a/numpy/core/code_generators/ufunc_docstrings.py b/numpy/core/code_generators/ufunc_docstrings.py index 615970816..c51b3cae1 100644 --- a/numpy/core/code_generators/ufunc_docstrings.py +++ b/numpy/core/code_generators/ufunc_docstrings.py @@ -3744,7 +3744,7 @@ add_newdoc('numpy.core.umath', 'ldexp', add_newdoc('numpy.core.umath', 'gcd', """ - Returns the greatest common divisor of |x1| and |x2| + Returns the greatest common divisor of x1 and x2 Parameters ---------- @@ -3774,7 +3774,7 @@ add_newdoc('numpy.core.umath', 'gcd', add_newdoc('numpy.core.umath', 'lcm', """ - Returns the lowest common multiple of |x1| and |x2| + Returns the lowest common multiple of x1 and x2 Parameters ---------- diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src index 9df635dee..cb4af0d12 100644 --- a/numpy/core/src/multiarray/scalartypes.c.src +++ b/numpy/core/src/multiarray/scalartypes.c.src @@ -1607,7 +1607,8 @@ static PyGetSetDef gentype_getsets[] = { /* 0-dim array from scalar object */ -static char doc_getarray[] = "sc.__array__(|type) return 0-dim array"; +static char doc_getarray[] = "sc.__array__(dtype) return 0-dim array from " + "scalar with specified dtype"; static PyObject * gentype_getarray(PyObject *scalar, PyObject *args) |