Skip to content
Advertisement

Save DataFrame to csv encounters error “ImportError: cannot import name ‘StringIO'”

I have a pandas DataFrame output_df that I can manipulate or print without problems. However, when I run output_df.to_csv(output_filename), it gives an error:

JavaScript

My pandas version is 0.25.1

Advertisement

Answer

got it from here

It seems that you have to downgrade your pandas version to 0.24.2 or lower. Hope it helps

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement