- [Instructor] One of the most common ways
of working with spreadsheet data is with CSV,
or comma-separated values, files.
A CSV file is a simple file format
for storing data in a table-like structure
as a series of rows of values
separated usually by commas.
If you think about how a spreadsheet
contains data within rows and columns,
you can see how a CSV file represents
the exact same data structure using plain text.
Because of this simplicity,
CSV files are incredibly versatile.
They are a common way of transferring data
between different programs,
such as databases and spreadsheet applications.
So let's take a look at a very simple example of a CSV file.
In this case, we have some stock related data,
including a ticker symbol,
the name of the company,
and the opening and closing price for a particular day.
So each row represents
a different ticker symbol and company.
This is a plain text file,
so you can edit it using any text editor,
although usually you would use a program
similar to Excel or Google Sheets or something similar.
In the rest of this chapter, we're going to see
how to use Python to perform basic operations
on CSV files using the built-in CSV module
in the standard library.