Create half-precision floating point type.
Examples
Create an instance of float16 type:
>>> import pyarrow as pa >>> pa.float16() DataType(halffloat) >>> print(pa.float16()) halffloat
Create an array with float16 type:
>>> arr = np.array([1.5, np.nan], dtype=np.float16) >>> a = pa.array(arr, type=pa.float16()) >>> a <pyarrow.lib.HalfFloatArray object at ...> [ 1.5, nan ]
Note that unlike other float types, if you convert this array to a python list, the types of its elements will be np.float16
>>> [type(val) for val in a.to_pylist()] [<class 'float'>, <class 'float'>]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4