How to save as CSV file in Python using Pandas
• 1 minAs said previously, CSV files are another industry standard.
Widely used when dealing with structured data shaped in DataFrame like structure.
Saving our csv file
df = pd.DataFrame({"firstname" : ['George', 'Aman', 'Dennis', 'John', 'Foe'], "lastname": ['Dubois', 'Van Hein', 'Washington', 'Doe', 'Less']})
Now that we have our DataFrame ready
df.to_csv("path/to/file.csv")
Here you are ! You know now how to save files as CSV in Python.
How to read a CSV file in Python
You might want to check the other article I wrote on how to read a csv file in Python using Pandas.
How to read a CSV file in Python using Pandas
The simplest way to read csv file in Python.Using the pandas library we can transform the csv into a workable dataframe object that looks just like an excel sheet.