From the course: Practice It: Python Data Structures

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Try it: Reading CSV files

Try it: Reading CSV files

(keyboard clacking) - [Instructor] A really cool use of namedtuple is reading data. Let's practice by reading a CSV and printing the values. Nadia wants to read in her customer data so that she can easily manipulate it later. We have included Customer.csv in the data directory. You will have to use a CSV reader to read in data, then use the first row as the field names for your named tuple. After that, you can create named tuples from rows two and beyond so that Nadia can easily use this customer data. If you'd like to practice by yourself, please pause the video here and practice. Otherwise, keep going to practice with me.

Contents