4.4 Data Acquisition
: 30 minutes
We conclude this section by demonstrating the most common data acquisition techniques.
Reading Data from csv
The extension csv
stands for “comma separated values”. So, essentially they are text files containing raw data, occasionally with a header describing the columns.
Since the value are comma-delimited, use pandas.read_csv(local_file)
to read the data into a DataFrame.
There are dozens of optional arguments available for .read_csv()
; see the documentation.
Writing Data to csv
To permanently save the content of a DataFrame into a local file, use DataFrame’s to_csv
method.