Python Tutorial: Modifying flat file imports

30 Mar 2020 · 5 min
4:35

In this instructional video, the presenter demonstrates how to import only a portion of a large flat file into a pandas DataFrame, using a U.S. tax dataset as a running example. The tutorial covers four main techniques: (1) selecting specific columns with the `usecols` argument (by name, index, or a custom function), (2) limiting the number of rows read with `nrows`, (3) processing a file in chunks by combining `skiprows` and `nrows` while handling the header row appropriately, and (4) assigning column names manually via the `names` parameter when the header is omitted. The speaker shows how to verify that different import methods yield identical results, how to construct a list of column names from an existing DataFrame, and how to combine these options to efficiently load manageable subsets of a large dataset. The lesson concludes by encouraging viewers to practice these workflows for better memory management and data handling.

Chapters

More from Richie

youtube.com

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

5mo ago
youtube.com

17.8% of the World Now Uses AI — And the Gap Is Widening | The Median #5

5mo ago
youtube.com

Create GPTs to Automate Go-To-Market Research

5mo ago
youtube.com

What Happened to Self-Driving Cars? #AI

5mo ago
youtube.com

Never Use AI For This #warning #AI #flights

5mo ago
youtube.com

Use AI Agents to Analyze Power Grid Optimization

5mo ago
youtube.com

This is how modern AI actually solves problems #AITrends #AI

5mo ago
youtube.com

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

5mo ago
youtube.com

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

5mo ago
youtube.com

Build an AI‑driven Dashboard

5mo ago
youtube.com

What’s Broken in Labor Markets Today #datascience

5mo ago
See all content