Numpy 的 base
屬性返回數組的基礎對象。如果對象 B 派生自對象 A(即共享內存位置),則對象 A 將是對象 B 的基礎。
例子
考慮以下代碼片段:
a = np.array([1,2])
b = a.view()
b.base is a
True
這裏,數組 b
與 a
共享相同的內存地址(從技術上講,b
是 a
的視圖),因此 b.base is a
的計算結果為 True
。
相關用法
- Python base64.b64decode()用法及代碼示例
- Python base64.b32decode()用法及代碼示例
- Python base64.b85encode()用法及代碼示例
- Python base64.b64encode()用法及代碼示例
- Python base64.decodebytes(s)用法及代碼示例
- Python base64.a85encode()用法及代碼示例
- Python base64.decodestring(s)用法及代碼示例
- Python base64.urlsafe_b64decode(s)用法及代碼示例
- Python base64.b16encode()用法及代碼示例
- Python base64.standard_b64decode(s)用法及代碼示例
- Python base64.encodebytes(s)用法及代碼示例
- Python base64.encodestring(s)用法及代碼示例
- Python base64.b85decode()用法及代碼示例
- Python base64.b16decode()用法及代碼示例
- Python base64.urlsafe_b64encode(s)用法及代碼示例
- Python base64.a85decode()用法及代碼示例
- Python base64.standard_b64encode(s)用法及代碼示例
- Python base64.b32encode()用法及代碼示例
- Python NumPy busdaycalendar對象用法及代碼示例
- Python binascii.crc32用法及代碼示例
- Python bytes.isupper用法及代碼示例
- Python bokeh.plotting.figure.asterisk()用法及代碼示例
- Python bytes.zfill用法及代碼示例
- Python binary轉string用法及代碼示例
- Python bytes.expandtabs用法及代碼示例
注:本文由純淨天空篩選整理自Isshin Inada大神的英文原創作品 NumPy | base property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。