本文簡要介紹 python 語言中  numpy.asscalar  的用法。
用法:
numpy.asscalar(a)將大小為 1 的數組轉換為其等效的標量。
- a: ndarray
 大小為 1 的輸入數組。
- out: 標量
 a的標量表示。輸出數據類型與輸入的 item 方法返回的類型相同。
參數:
返回:
例子:
>>> np.asscalar(np.array([24])) 24
相關用法
- Python numpy ascontiguousarray用法及代碼示例
 - Python numpy asarray_chkfinite用法及代碼示例
 - Python numpy asanyarray用法及代碼示例
 - Python numpy asarray用法及代碼示例
 - Python numpy asmatrix用法及代碼示例
 - Python numpy asfortranarray用法及代碼示例
 - Python numpy asfarray用法及代碼示例
 - Python numpy any用法及代碼示例
 - Python numpy argpartition用法及代碼示例
 - Python numpy arctan用法及代碼示例
 - Python numpy array用法及代碼示例
 - Python numpy array_repr用法及代碼示例
 - Python numpy arccos用法及代碼示例
 - Python numpy all用法及代碼示例
 - Python numpy add用法及代碼示例
 - Python numpy around用法及代碼示例
 - Python numpy array2string用法及代碼示例
 - Python numpy atleast_1d用法及代碼示例
 - Python numpy arctan2用法及代碼示例
 - Python numpy angle用法及代碼示例
 - Python numpy arctanh用法及代碼示例
 - Python numpy apply_over_axes用法及代碼示例
 - Python numpy arccosh用法及代碼示例
 - Python numpy arange用法及代碼示例
 - Python numpy argsort用法及代碼示例
 
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.asscalar。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
