当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python numpy.byte_bounds()用法及代码示例


numpy.byte_bounds()函数返回指向数组end-points的指针。

用法: numpy.byte_bounds(arr)
参数:
arr: [ndarray] Input array.
返回: [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)

相关用法


注:本文由纯净天空筛选整理自sanjoy_62大神的英文原创作品 numpy.byte_bounds() function – Python。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。