我有一个熊猫DataFrame output_df
,我可以毫无问题地操作或打印它。但是,当我运行output_df.to_csv(output_filename)
时,会出现错误:
File "my_file.py", line 169, in run_attribute_generator
output_df.to_csv(output_filename)
File "/usr/local/lib/python3.6/site-packages/pandas/core/generic.py", line 3204, in to_csv
New Series or DataFrame with updated labels.
File "/usr/local/lib/python3.6/site-packages/pandas/io/formats/csvs.py", line 17, in <module>
from pandas.compat import (StringIO, range, zip)
ImportError: cannot import name 'StringIO'
我的熊猫版本是0.25.1