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

-2

How do I create a csv file please anyone

csv file

csv

5/1/2022 9:55:59 AM

Emeku Abel🇳🇬

3 Answers

New Answer

+3

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: https://docs.python.org/3/library/csv.html

+2

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

+2

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.