Categories
Python Answers

How to avoid Python Pandas creating an index in a saved CSV?

Spread the love

To avoid Python Pandas creating an index in a saved CSV, we set the index option to false.

For instance, we write`

df.to_csv('your.csv', index=False)

to call to_csv with the file path and the index argument set to False to avoid adding the index in the CSV.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *