numpy.byte_bounds()函数– Python
numpy.byte_bounds()
函数返回指向数组端点的指针。
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.
代码#1:
# Python program explaining
# numpy.byte_bounds() function
# importing numpy as geek
import numpy as geek
arr = geek.eye(2, dtype = 'f')
gfg = geek.byte_bounds(arr)
print (gfg)
输出 :
(37062512, 37062528)
代码#2:
# Python program explaining
# numpy.byte_bounds() function
# importing numpy as geek
import numpy as geek
arr = geek.eye(2)
gfg = geek.byte_bounds(arr)
print (gfg)
输出 :
(30421344, 30421376)