为什么base64可以编码ndarray但不能编码arrow?

时间:2019-07-10 03:27:47

标签: base64 numpy-ndarray pyarrow

在以下代码中,

t = numpy.arange(25, dtype=np.float64)
a = pyarrow.array(t)

s1 = base64.b64encode(t) # this works
s2 = base64.b64encode(a)

这引发错误,说

a bytes-like object is required
not 'pyarrow.lib.DoubleArray'

ndarray是一个类似字节的对象吗?有什么不同?并且base64可以编码pyarrow对象吗?

0 个答案:

没有答案