Python for Beginners: CSV Parsing (Part 1) - Parsing a Simple CSV File

preview_player
Показать описание
Part 1 of my CSV (comma-separated value) file parsing tutorial for beginners in Python.

In this video, I show you how to use Python's standard CSV library to parse and operate on simple CSV files.

Follow me on Twitter!

Inspired by Kevin MacLeod
Рекомендации по теме
Комментарии
Автор

You should make more of these videos, you have a real knack for it. I like how you explain each line of code, what it does, and why it is there. You would be surprised, but many teachers can't even do that (I have taken many professional education courses in Python, programming, etc., at major schools like the University of Washington).

I have been trying to learn the csv parsing, and this video series got me over some hurdles. I work as a data analyst, doing similar work, webscraping or csv file parsing to automate mundane, time consuming stuff at work.

Keep using the techy sound track, that helps to get in the space of this.

Thanks!

vincenzo
Автор

This is the best explained video that doesnt rush through the entire code in 10 secs, but properly elaborated. I was so frustrated with csv files, this helped alot.

dominictey
Автор

Thank you, I needed this refresher. I had not done any real python work in a couple years and something about your presentation style brought it back pretty quickly. I hope you do more videos like this.

nadieselgirl
Автор

You have a seriously great way of teaching Python. I have been trying to understand these concepts from a variety of sources and your video is what allowed it to click for me. Please keep doing your thing!

connorphillips
Автор

3:40 "capture the hetero" had me rolling. Thanks so much for this! Helped me out a ton

humanthehuman
Автор

I'm glad I found this underrated video! Very informative and very precise. Thanks for providing more information in much less time. Don't give up mate! You're gonna get much bigger in next few years! Keep grinding! All the best! Gotta watch the next part lol

jaianupamvarun
Автор

I really like the way you structured this. You did a great job of explaining each step. Great job!! Thanks for that.

Miracura
Автор

When you explained that you don't need to have a csv file already created that python creates it automatically, I knew I was going to like and follow. Love that level of detail that so many blow off.

bman
Автор

Hi Scott, just gotta say that this some of the best Python-related content I've come across. Do you plan to produce any more?

petercawthorne
Автор

bro great explanation keep it up we, need more videos like this on json, xml etc ..lots of love from India

shin-channohara
Автор

oh my god this was amazing. I love you.

juliabradley
Автор

If anyone is having problems with Null byte errors, you may need to modify the open statement with something like: with open('filename.csv', 'r', newline ='', encoding = 'utf-16') as infile:

chrisjones
Автор

Yes!! Thank you so much!
This is the solution I was looking for... I used .append to add rows to the new .csv file but it was filled with excess commas and quotation marks.
However, with this, that is not the case.

ivanmatejcic
Автор

Thank you so much for this video, it helped me a lot

Mineshafts
Автор

Thank you so much. Clear, to the point. Stay healthy and safe.

christopherjspiteri
Автор

For those confused by line 7, "header = next(reader)":

Two things are happening here: 1, the next() command is telling the csv reader to point one row down so it's now pointing at the 2nd row, skipping over the header we typically don't want to parse in our for loop, and 2, then the equality operator is storing the first line we skipped in the variable "header" in case we want it in the future.

brendanreeves
Автор

Hello
Thanks for the great video.
Question. I have 1000s of CSV files in one folder. I need your read these files one by one and extract a specific text. Finally, print file name and next to it print that extracted text. Any suggestions

khalidjj
Автор

I'm interested in how you would only "grab" or write something more specific, like only printing the students that received a C [without use of panda]

coralswank
Автор

Hello, thank you so much your video is so well explained!

Could you please help me get out of a doubt I have about it though?

It might be because english is my second lenguage, but in the for loop, it seems that it is giving you the element of each row from the column. I get a little lost because, row[0] seems to be the column[0] and the for iterates on each row, but then row is really not row it is column?

I'm not sure if I'm making sense, but it looks like if the "row" in the for is both row and column.

joshuaoseguera
Автор

Nicely explained and easy to follow. Just as a slight criticism, I found the background music a bit distracting.

jeremycollum