From the course: Data Ingestion with Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Working in CSV

Working in CSV - Python Tutorial

From the course: Data Ingestion with Python

Start my 1-month free trial

Working in CSV

- [Instructor] CSV is a very common format. The main advantage of CSV is that it can easily be exported or imported by Excel. CSV's also have several downsides. They don't keep type information, everything is a string. There's no standard of specification. And it's hard to work with unicode data inside CSV's. Let's have a look at some CSV data. It's a file called taxi.csv.bz2 in our exercise file. The file is compressed, which is common with CSV files that hold a lot of data. CSV is text, and text can be compressed a lot. For example, our uncompressed file is about eight times bigger than the compressed one. We see that the first line is a header line, with the names of the columns. And then we have data lines, each holds values separated by comma. This data is from the New York taxi data, which holds data on taxi rides in New York City. This file has ten thousand one lines, which means we have one line of header, and then ten thousand lines of data. In Python, we have two options to…

Contents