You are viewing an older version (2.4.3). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / lib / array_utils / byte_bounds

function

numpy.lib.array_utils:byte_bounds

source: /numpy/lib/_array_utils_impl.py :11

Signature

def   byte_bounds ( a )

Summary

Returns pointers to the end-points of an array.

Parameters

a : ndarray

Input array. It must conform to the Python-side of the array interface.

Returns

(low, high) : tuple of 2 integers

The first integer is the first byte of the array, the second integer is just past the last byte of the array. If a is not contiguous it will not use every byte between the (low, high) values.

Examples

import numpy as np
I = np.eye(2, dtype='f'); I.dtype
low, high = np.lib.array_utils.byte_bounds(I)
high - low == I.size*I.itemsize
I = np.eye(2); I.dtype
low, high = np.lib.array_utils.byte_bounds(I)
high - low == I.size*I.itemsize

Aliases

  • numpy.lib._array_utils_impl.byte_bounds