>>> import pandas as pd
>>> df = pd.read_pickle("data.zip", compression="zip")
>>> df.to_csv("data.csv",encoding="gbk")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python38\lib\site-packages\pandas\core\generic.py", line 3204, in to_csv
formatter.save()
File "C:\Python38\lib\site-packages\pandas\io\formats\csvs.py", line 204, in save
self._save()
File "C:\Python38\lib\site-packages\pandas\io\formats\csvs.py", line 323, in _save
self._save_chunk(start_i, end_i)
File "C:\Python38\lib\site-packages\pandas\io\formats\csvs.py", line 354, in _save_chunk
libwriters.write_csv_rows(self.data, ix, self.nlevels, self.cols, self.writer)
File "pandas\_libs\writers.pyx", line 48, in pandas._libs.writers.write_csv_rows
UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 31: illegal multibyte sequence
在转换格式的时候出错了,而且直接导入txt老是不成功