numpy.byte_bounds() function – Python (original) (raw)
Last Updated : 08 Jul, 2020
numpy.byte_bounds()
function returns pointers to the end-points of an array.
Syntax : numpy.byte_bounds(arr)
Parameters :
arr : [ndarray] Input array.
Return : [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 arr is not contiguous it will not use every byte between the (low, high) values.
Code #1 :
import
numpy as geek
arr
=
geek.eye(
2
, dtype
=
'f'
)
gfg
=
geek.byte_bounds(arr)
print
(gfg)
Output :
(37062512, 37062528)
Code #2 :
import
numpy as geek
arr
=
geek.eye(
2
)
gfg
=
geek.byte_bounds(arr)
print
(gfg)
Output :
(30421344, 30421376)
Similar Reads
- numpy.finfo() function – Python numpy.finfo() function shows machine limits for floating point types. Syntax : numpy.finfo(dtype) Parameters : dtype : [float, dtype, or instance] Kind of floating point data-type about which to get information. Return : Machine parameters for floating point types. Code #1 : # Python program explain 1 min read
- numpy.frombuffer() function – Python numpy.frombuffer() function interpret a buffer as a 1-dimensional array. Syntax : numpy.frombuffer(buffer, dtype = float, count = -1, offset = 0) Parameters : buffer : [buffer_like] An object that exposes the buffer interface. dtype : [data-type, optional] Data-type of the returned array, default da 1 min read
- numpy.bitwise_and() in Python numpy.bitwise_and() function is used to Compute the bit-wise AND of two array element-wise. This function computes the bit-wise AND of the underlying binary representation of the integers in the input arrays. Syntax : numpy.bitwise_and(arr1, arr2, /, out=None, *, where=True, casting='same_kind', ord 2 min read
- numpy.who function - Python numpy.who() function print the NumPy arrays in the given dictionary. Syntax : numpy.who(vardict = None) Parameters : vardict : [dict, optional] A dictionary possibly containing ndarrays. Return : Returns ‘None’. If there is no dictionary passed in or vardict is None then returns NumPy arrays in the 1 min read
- Numpy size() function | Python numpy.size() function in Python is used to count the number of elements in a NumPy array. You can use it to get the total count of all elements, or to count elements along a specific axis, such as rows or columns in a multidimensional array. This makes it useful when quickly trying to understand the 2 min read
- numpy.iinfo() function – Python numpy.iinfo() function shows machine limits for integer types. Syntax : numpy.iinfo(dtype) Parameters : dtype : [integer type, dtype, or instance] The kind of integer data type to get information about. Return : Machine limits for integer types. Code #1 : # Python program explaining # numpy.iinfo() 1 min read
- bytearray() function - Python The bytearray() function in Python creates a mutable sequence of bytes, which is essentially an array of integers in the range 0 to 255 (representing byte values). Unlike the immutable bytes type, bytearray allows us to modify its contents after creation, making it useful for tasks like binary data 5 min read
- numpy.pad() function in Python numpy.pad() function is used to pad the Numpy arrays. Sometimes there is a need to perform padding in Numpy arrays, then numPy.pad() function is used. The function returns the padded array of rank equal to the given array and the shape will increase according to pad_width. Syntax: numpy.pad(array, p 2 min read
- numpy.eye() in Python numpy.eye() is a function in the NumPy library that creates a 2D array with ones on the diagonal and zeros elsewhere. This function is often used to generate identity matrices with ones along the diagonal and zeros in all other positions. Let's understand with the help of an example: [GFGTABS] Pytho 2 min read
- numpy.base_repr() in Python numpy.base_repr(number, base=2, padding=0) function is used to return a string representation of a number in the given base system. For example, decimal number 10 is represented as 1010 in binary whereas it is represented as 12 in octal. Syntax : numpy.base_repr(number, base=2, padding=0) Parameters 3 min read