Search
Searching.
- numpy.ndarray.base
...NumPy reference Array objects The N-dimensional array (ndarray) numpy.ndarray.base...
- numpy.ndarray.base (Python attribute, in numpy.ndarray.base)
- Array creation
...creating arrays as laid out in the Array creation routines. These functions can be split into roughly three categories, based on the dimension of the array they create: 1D arrays 2D arrays ndarrays 1 - 1D array creation functions The 1D...
- Array iterator API
...ode. Iteration example The best way to become familiar with the iterator is to look at its usage within the NumPy codebase itself. For example, here is a slightly tweaked version of the code for PyArray_CountNonzero, which counts the numb...
- Beyond the basics
...ability to sub-class types in C. This facility is one of the important reasons for basing NumPy off of the Numeric code-base which was already in C. A sub-type in C allows much more flexibility with regards to memory management. Sub-typing...
- Constants of the
numpy.ma
module..., mask=[[0, 1], [1, 0]]) >>> x.data matrix([[1, 2], [3, 4]]) The type of the data can be accessed through the baseclass attribute. ma.MaskedArray.mask Current mask. ma.MaskedArray.recordmask Get or set the mask of the arra...
- How to extend NumPy
...By constructing a new ndarray of your desired shape and type using PyArray_NewFromDescr or a simpler macro or function based on it. Get the shape of the array and a pointer to its actual data. Pass the data and shape information on to a...
- How to index
ndarrays
...the ndarray: >>> np.flatnonzero(z) array([0, 1, 2, 6, 7, 8, 9]) Arbitrary conditions Use where to generate indices based on conditions and then use Advanced indexing. >>> a = np.arange(30).reshape(2, 3, 5) >>> indices = np.where(a % 2...
- Indexing on
ndarrays
...g Single element indexing Single element indexing works exactly like that for other standard Python sequences. It is 0-based, and accepts negative indices for indexing from the end of the array. >>> x = np.arange(10) >>> x[2] 2 >>> x[-2] 8...
- Interoperability with NumPy
...objects provide both a high-level API for operations on array-structured data and a concrete implementation of the API based on strided in-RAM storage. While this API is powerful and fairly general, its concrete implementation has limitati...
- Memory management in NumPy
...ot to emit a warning, this may change in a future version of NumPy. A better technique would be to use a PyCapsule as a base object: /* define a PyCapsule_Destructor, using the correct deallocator for buff */ void free_wrap(void *capsule){...
- NumPy 1.10.0 Release Notes
...er of the axes, in which case the input array was returned. A view is now returned in all cases. nonzero now returns base ndarrays Previously, an inconsistency existed between 1-D inputs (returning a base ndarray) and higher dimensional...
- NumPy 1.11.0 Release Notes
...ors These operators are implemented with the remainder and floor_divide functions respectively. Those functions are now based around fmod and are computed together so as to be compatible with each other and with the Python versions for floa...
- NumPy 1.12.0 Release Notes
...ameter to binary_repr If a ‘width’ parameter is passed into binary_repr that is insufficient to represent the number in base 2 (positive) or 2’s complement (negative) form, the function used to silently ignore the parameter and return a rep...
- NumPy 1.14.0 Release Notes
...calars unambiguously with control of rounding and padding. PyArray_ResolveWritebackIfCopy and PyArray_SetWritebackIfCopyBase, new C-API functions useful in achieving PyPy compatibility. Deprecations Using np.bool_ objects in place of in...
- NumPy 1.15.0 Release Notes
...ted. For testing, we have switched to pytest as a replacement for the no longer maintained nose framework. The old nose based interface remains for downstream projects who may still be using it. The Python versions supported by this release...
- NumPy 1.16.0 Release Notes
...NaT comparisons now return False without a warning, finishing a deprecation cycle begun in NumPy 1.11. np.lib.function_base.unique was removed, finishing a deprecation cycle begun in NumPy 1.4. Use numpy.unique instead. multi-field indexin...
- NumPy 1.17.0 Release Notes
...e slightly more often In rare cases, it was not possible to switch an array from not writeable to writeable, although a base array is writeable. This can happen if an intermediate ndarray.base object is writeable. Previously, only the deepe...
- NumPy 1.18.2 Release Notes
...rtran link in azure Mac testing. #15679: BUG: Added missing error check in ndarray.__contains__ #15722: MAINT: use list-based APIs to call subprocesses #15729: REL: Prepare for 1.18.2 release. #15734: BUG: fix logic error when nm fails on 3...
- NumPy 1.20.0 Release Notes
...For such a dtype the following behaviour is true: res = np.array(arr, dtype) res.dtype is not dtype res.dtype is dtype.base res.shape == arr.shape + dtype.shape But res is filled using the logic: res = np.empty(arr.shape + dtype.shape, d...
- NumPy 1.21.0 Release Notes
...The function PyUFunc_SetUsesArraysAsData has been disabled. It was deprecated in NumPy 1.19. (gh-18697) The class PolyBase has been removed (deprecated in numpy 1.9.0). Please use the abstract ABCPolyBase class instead. (gh-18963) The un...
- NumPy 1.21.1 Release Notes
...mparisons for zero sized voids #19352: BUG: Correct Cython declaration in random #19353: BUG: protect against accessing base attribute of a NULL subarray #19365: BUG, SIMD: Fix detecting AVX512 features on Darwin #19366: MAINT: remove print...
- NumPy 1.22.0 Release Notes
...e Python versions supported in this release are 3.8-3.10, Python 3.7 has been dropped. Note that the Mac wheels are now based on OS X 10.14 rather than 10.9 that was used in previous NumPy release cycles. 10.14 is the oldest release support...
- NumPy 1.22.3 Release Notes
...problems with older code. The Python versions supported for this release are 3.8-3.10. Note that the Mac wheels are now based on OS X 10.14 rather than 10.9 that was used in previous NumPy release cycles. 10.14 is the oldest release support...
- NumPy 1.23.0 Release Notes
...ators Reduction operations like numpy.sum, numpy.prod, numpy.add.reduce, numpy.logical_and.reduce on contiguous integer-based arrays are now much faster. (gh-21001) Faster np.where numpy.where is now much faster than previously on unpredi...
- NumPy 1.25.0 Release Notes
...s EOFError instead, in both cases. (gh-23105) np.pad with mode=wrap pads with strict multiples of original data Code based on earlier version of pad that uses mode="wrap" will return different results when the padding size is larger tha...
- NumPy 1.5.0 Release Notes
...the first NumPy release which is compatible with Python 3. Support for Python 3 and Python 2 is done from a single code base. Extensive notes on changes can be found at https://web.archive.org/web/20100814160313/http://projects.scipy.org/nu...
- NumPy 1.7.0 Release Notes
...oduces the string ‘test’, and now np.logical_and(np.array(3, ‘O’), np.array(‘test’, ‘O’)) produces ‘test’ as well. The .base attribute on ndarrays, which is used on views to ensure that the underlying array owning the memory is not dealloca...
- NumPy 1.8.0 Release Notes
...upports Python 2.6 -2.7 and 3.2 - 3.3. Highlights New, no 2to3, Python 2 and Python 3 are supported by a common code base. New, gufuncs for linear algebra, enabling operations on stacked arrays. New, inplace fancy indexing for ufuncs wit...
- NumPy 1.9.0 Release Notes
...verflows the array type, TypeError is raised instead of OverflowError. Polynomial Classes no longer derived from PolyBase This may cause problems with folks who depended on the polynomial classes being derived from PolyBase. They are now...
- NumPy 2.0 migration guide
...RSION < 0x02000000 #define PyDataType_ELSIZE(descr) ((descr)->elsize) #endif or adding npy2_compat.h into your code base and explicitly include it when compiling with NumPy 1.x (as they are new API). Including the file has no effect on...
- NumPy 2.0.0 Release Notes
...in all cases, although only after the result array is filled. In those code paths, __array_wrap__ will now be passed a base class, rather than a subclass array. (gh-25105) Deprecations np.compat has been deprecated, as Python 2 is no l...
- NumPy 2.1.0 Release Notes
...NumPy, the solution is to make sure you #include "numpy/ndarrayobject.h" before their header and import NumPy yourself based on including-the-c-api. (gh-26103) Many shims removed from npy_3kcompat.h Many of the old shims and helper func...
- NumPy C code explanations
- NumPy for MATLAB users
...e other hand, the API for adding GUIs and creating full-fledged applications is more or less an afterthought. NumPy is based on Python, a general-purpose language. The advantage to NumPy is access to Python libraries including: SciPy, Mat...
- NumPy quickstart
...e data. The view method creates a new array object that looks at the same data. >>> c = a.view() >>> c is a False >>> c.base is a # c is a view of the data owned by a True >>> c.flags.owndata False >>> >>> c = c.reshape((2, 6))...
- numpy.array
- numpy.asarray
...o copy is performed if the input is already an ndarray with matching dtype and order. If a is a subclass of ndarray, a base class ndarray is returned. See also asanyarraySimilar function which passes through subclasses. ascontiguous...
- numpy.asarray_chkfinite
...yArray interpretation of a. No copy is performed if the input is already an ndarray. If a is a subclass of ndarray, a base class ndarray is returned. Raises: ValueErrorRaises ValueError if a contains NaN (Not a Number) or Inf (Infinit...
- numpy.atleast_2d
....atleast_2d(3.0) array([[3.]]) >>> x = np.arange(3.0) >>> np.atleast_2d(x) array([[0., 1., 2.]]) >>> np.atleast_2d(x).base is x True >>> np.atleast_2d(1, [1, 2], [[1, 2]]) (array([[1]]), array([[1, 2]]), array([[1, 2]]))...
- numpy.atleast_3d
- numpy.char.chararray.astype
- numpy.char.chararray.flags
- numpy.char.isdigit
- numpy.copy
- numpy.einsum
- numpy.emath.log10
- numpy.emath.log2
- numpy.emath.logn
- numpy.empty_like
- numpy.exp
- numpy.flatiter
- numpy.float_power
- numpy.full_like
- numpy.generic.base
- numpy.geomspace
- numpy.in1d
- numpy.isin
- numpy.lib.scimath.log10
- numpy.lib.scimath.log2
- numpy.lib.scimath.logn
- numpy.lib.stride_tricks.sliding_window_view
- numpy.linalg.svd
- numpy.loadtxt
- numpy.log
- numpy.log10
- numpy.log2
- numpy.logaddexp
- numpy.logaddexp2
- numpy.logspace
- numpy.ma.asarray
- numpy.ma.atleast_2d
- numpy.ma.atleast_3d
- numpy.ma.masked_array.astype
- numpy.ma.masked_array.flags
- numpy.ma.MaskedArray.astype
- numpy.ma.MaskedArray.flags
- numpy.ma.MaskType.base
- numpy.ma.putmask
- numpy.matrix
- numpy.matrix.astype
- numpy.matrix.flags