我有一个数据框,其数据类型如下:
[2020-02-06 19:15:06,579] {logging_mixin.py:95} INFO -
campanha object
chave_sistema_origem int64
valor_ajustado object
当我尝试使用df.to_parquet(buffer, index=False)
写入parquet文件时,列valor_ajustado
的某个值引发了异常。
[2020-02-06 19:15:06,597] {taskinstance.py:1047} ERROR - an integer is required (got type str)
...
File "/Users/jackhammer/.virtualenvs/python373/lib/python3.7/site-packages/pyarrow/pandas_compat.py", line 540, in convert_column
result = pa.array(col, type=type_, from_pandas=True, safe=safe)
File "pyarrow/array.pxi", line 207, in pyarrow.lib.array
File "pyarrow/array.pxi", line 78, in pyarrow.lib._ndarray_to_array
我知道列
valor_ajustado
的值如下:
有人知道为什么它尝试操作整数而不是保持列为对象吗?0
123.48
1
493.987
valor_ajustado
列中的元素类型是什么?它们都是相同类型的吗? - AMC