i want to add a new sheet in existing CSV file with sheet name "summary" and write some data into the newly created sheet using python.
2 Answers
CSV is an acronym for "Comma Separated Values". It is not a table of any type, it's just what its name tells: multiple values, separated by commas. Excel and other table-processing utils has an ability to interpret this values as a table. And, since Excel keeps its tables organised as sheets, it will display your CSV as a table sheet. However CSV has no info about sheets at all. Sheets are not part of the CSV format. Related question can be found here.
As a possible solution, you may create a separate CSV for each sheet you'd like to use. That is not exactly what you want, but is similar to it.

- 427
- 2
- 12
CSV files don't have sheets. Maybe use you could use Excel instead if you really want multiple sheets, however in my opinion multiple CSV files are a more straightforward alternative.

- 2,845
- 1
- 5
- 10