Search
Search Results
Search finished, found 25 page(s) matching the search query.
- numpy.dtype.isnative
- numpy.dtype.isnative (Python attribute, in numpy.dtype.isnative)
- Array iterator API
...KIND_CASTING, and NPY_UNSAFE_CASTING. To allow the casts to occur, copying or buffering must also be enabled. If dtype isn’t NULL, then it requires that data type. If copying is allowed, it will make a temporary copy if the data is castabl...
- Interoperability with NumPy
...may have had, is lost. The signature of the method should be __array__(self, dtype=None, copy=None). If a passed dtype isn’t None and different than the object’s data type, a casting should happen to a specified type. If copy is None, a co...
- Miscellaneous
...ns instead. False >>> myarr[myarr == np.nan] = 0. # doesn't work >>> myarr array([ 1., 0., nan, 3.]) >>> myarr[np.isnan(myarr)] = 0. # use this instead find >>> myarr array([1., 0., 0., 3.]) Other related special value functions:...
- NumPy 1.14.0 Release Notes
...Python, which made it difficult to pass the argument by name. This has been fixed by renaming the parameter to from_. isnat raises TypeError when passed wrong type The ufunc isnat used to raise a ValueError when it was not passed variable...
- NumPy 1.21.2 Release Notes
...#19652: MAINT: add missing dunder method to nditer type hints #19656: BLD, SIMD: Fix testing extra checks when -Werror isn’t applicable… #19657: BUG: Remove logical object ufuncs with bool output #19658: MAINT: Include .coveragerc in sourc...
- NumPy 1.8.0 Release Notes
...e used in the future to apply q without needing to convert to a matrix. The ‘economic’ mode is simply deprecated, there isn’t much use for it and it isn’t any more efficient than the ‘raw’ mode. New invert argument to in1d The function in...
- numpy.dtype
...a struct which maintains field alignment. isbuiltinInteger indicating how this dtype relates to the built-in dtypes. isnativeBoolean indicating whether the byte order of this dtype is native to the platform. itemsizeThe element size of...
- numpy.dtype.isnative
...NumPy reference Array objects Data type objects (dtype) numpy.dtype.isnative...
- numpy.ma.MaskedArray.__array__
...nt data type of the array. For copy parameter it returns a new reference to self if copy=False or copy=None and copying isn’t enforced by dtype parameter. The method returns a new array for copy=True, regardless of dtype parameter. A more d...
- numpy.ma.maximum_fill_value
...an be queried for it’s numeric type. Returns: valscalarThe minimum representable value. Raises: TypeErrorIf obj isn’t a suitable numeric type. See also minimum_fill_valueThe inverse function. set_fill_valueSet the filling val...
- numpy.ma.minimum_fill_value
...an be queried for it’s numeric type. Returns: valscalarThe maximum representable value. Raises: TypeErrorIf obj isn’t a suitable numeric type. See also maximum_fill_valueThe inverse function. set_fill_valueSet the filling val...
- numpy.min
...re=<no value>)[source] Return the minimum of an array or minimum along an axis. Parameters: aarray_likeInput data. axisNone or int or tuple of ints, optionalAxis or axes along which to operate. By default, flattened input is used. If th...
- numpy.ndarray.__array__
...nt data type of the array. For copy parameter it returns a new reference to self if copy=False or copy=None and copying isn’t enforced by dtype parameter. The method returns a new array for copy=True, regardless of dtype parameter. A more d...
- NumPy: the absolute basics for beginners
...> unique_values = np.unique(a_2d) >>> print(unique_values) [ 1 2 3 4 5 6 7 8 9 10 11 12] If the axis argument isn’t passed, your 2D array will be flattened. If you want to get the unique rows or columns, make sure to pass the axis...
- NumPy’s module structure
...spaces Prefer not to use these namespaces for new code. There are better alternatives and/or this code is deprecated or isn’t reliable. numpy.char - legacy string functionality, only for fixed-width strings numpy.distutils (deprecated) - b...
- Testing guidelines
...t_yyy >>> test_yyy.test() __init__.py and setup.py Usually, however, adding the tests/ directory to the python path isn’t desirable. Instead it would better to invoke the test straight from the module xxx. To this end, simply place the...
- The
numpy.ma
module...[False, False, False], fill_value=999999) To unmask all masked entries of a masked array (provided the mask isn’t a hard mask), the simplest solution is to assign the constant nomask to the mask: >>> import numpy.ma as ma >>> x...
- Verifying bugs and bug fixes in NumPy
...iving result type np.complex128. This doesn’t happen with non-zero arguments; there the result is as expected. This bug isn’t present in np.convolve. Reproducing code example: >>> import numpy as np >>> np.__version__ '1.18.4' >>> a = np.ar...
- Array API
...scr) int PyArray_ISCOMPLEX(PyArrayObject *obj) Type represents any complex floating point number. int PyTypeNum_ISNUMBER(int num) int PyDataType_ISNUMBER(PyArray_Descr *descr) int PyArray_ISNUMBER(PyArrayObject *obj) Type re...
- Glossary
...views and copies falls to the programmer. numpy.shares_memory will check whether b is a view of a, but an exact answer isn’t always feasible, as the documentation page explains. >>> x = np.arange(5) >>> x array([0, 1, 2, 3, 4]) >>> y = x...
- Subclassing ndarray
...= arr.view(InfoArray) # view casting >>> type(cast_arr) <class 'InfoArray'> >>> cast_arr.info is None True This class isn’t very useful, because it has the same constructor as the bare ndarray object, including passing in buffers and shap...
- Troubleshooting
- Writing custom array containers
...ype=None, copy=None): ... if copy is False: ... raise ValueError( ... "`copy=False` isn't supported. A copy is always created." ... ) ... return self._i * np.eye(self._N, dtype=dtype)...