當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。