pyarrow.from_numpy_dtype

pyarrow.from_numpy_dtype(dtype)

Convert NumPy dtype to pyarrow.DataType.

Parameters:
dtypethe numpy dtype to convert

Examples

Create a pyarrow DataType from NumPy dtype:

>>> import pyarrow as pa
>>> import numpy as np
>>> pa.from_numpy_dtype(np.dtype('float16'))
DataType(halffloat)
>>> pa.from_numpy_dtype('U')
DataType(string)
>>> pa.from_numpy_dtype(bool)
DataType(bool)
>>> pa.from_numpy_dtype(np.str_)
DataType(string)