From the course: Faster pandas

Unlock the full course today

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

Solution: Reducing memory

Solution: Reducing memory

From the course: Faster pandas

Start my 1-month free trial

Solution: Reducing memory

(upbeat music) - [Instructor] Let's take a look at the solution. We start by initializing the minimum and maximum distance to infinity and negative infinity. Then we use rich CSV. We tell rich CSV to load the data from taxi.csv.xz. Load only the trip_distance column and use a chunk size of 50,000. Then for every data frame, we use the .describe method to get some statistics. And then update the minimum and maximum distance from the description min and max. And finally, we print out the minimum and maximum distance. Let's run it, so python dist_edges.py. So python dist_edges.py. And we can see that the minimum distance is 0 and the maximum is 111.1 miles.

Contents