Python:csv
lastmod 2026-11-10created 2018-09-213 edits
csv is the Python standard library module for reading and writing comma-separated values (CSV) files. reader and writer handle rows as lists, while DictReader and DictWriter handle them as dictionaries keyed by the header; the delimiter and quoting rules are specified with a dialect. Because it correctly quotes commas and line breaks inside fields, it is safer than parsing by hand with string splitting. Files must be opened with newline='' to avoid blank lines, and pandas is more convenient for analyzing large tabular data.