How do I create a csv file please anyone | Sololearn: Learn to code for FREE!


How do I create a csv file please anyone

csv file


5/1/2022 9:55:59 AM

Emeku Abel🇳🇬

3 Answers

New Answer


Emeku Abel , python has a modul named csv that can be imported and then used. you can find the documentation and also some samples here:


A csv file is a a simple text file. Create it like any other text file. The pandas module provides methods for writing csv files, too


The rules for writing CSVs are simple. Insert commas between output values. If you are writing strings, then replace any double quotes with two double quotes (" -> ""). Check each string to see whether it contains a comma. If so, then enclose the whole string inside double quotes. If there is no comma, then just write the string.