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

  Рет қаралды 52,891

Scott

Scott

Күн бұрын

Пікірлер
@vincenzo3292
@vincenzo3292 4 жыл бұрын
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!
@scott_hull
@scott_hull 4 жыл бұрын
Thanks so much, it means a lot that you took the time to write all of this. Yes, I’ll have more time soon to make more of these. Thanks for the kind words!
@dominictey2663
@dominictey2663 3 жыл бұрын
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.
@bman26793
@bman26793 2 жыл бұрын
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.
@connorphillips1929
@connorphillips1929 2 жыл бұрын
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!
@nadieselgirl
@nadieselgirl 3 жыл бұрын
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.
@humanthehuman
@humanthehuman 4 жыл бұрын
3:40 "capture the hetero" had me rolling. Thanks so much for this! Helped me out a ton
@petercawthorne1104
@petercawthorne1104 Жыл бұрын
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?
@jaianupamvarun5342
@jaianupamvarun5342 3 жыл бұрын
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
@marcfacca5651
@marcfacca5651 4 жыл бұрын
Epic CSV parse build strats bro!
@Miracura
@Miracura 3 жыл бұрын
I really like the way you structured this. You did a great job of explaining each step. Great job!! Thanks for that.
@shin-channohara3202
@shin-channohara3202 2 жыл бұрын
bro great explanation keep it up we, need more videos like this on json ,xml etc ..lots of love from India
@christopherjspiteri
@christopherjspiteri 4 жыл бұрын
Thank you so much. Clear, to the point. Stay healthy and safe.
@brendanreeves9645
@brendanreeves9645 Жыл бұрын
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.
@chrisjones1646
@chrisjones1646 3 жыл бұрын
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:
@juliabradley8917
@juliabradley8917 2 жыл бұрын
oh my god this was amazing. I love you.
@jackscott1097
@jackscott1097 Жыл бұрын
gee thanks scott, very informative!
@Vhix
@Vhix 4 жыл бұрын
Just what I needed, thank you!
@danielhux
@danielhux 2 жыл бұрын
Thanks for this, clears up a lot.
@ivanmatejcic3776
@ivanmatejcic3776 2 жыл бұрын
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.
@ratanghosh2767
@ratanghosh2767 3 жыл бұрын
awesome tutorial
@Mineshafts
@Mineshafts 3 жыл бұрын
Thank you so much for this video, it helped me a lot
@muhammadfitrie7061
@muhammadfitrie7061 3 жыл бұрын
excellent video!!!!
@khalidjj2073
@khalidjj2073 3 жыл бұрын
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
@joshuaoseguera9361
@joshuaoseguera9361 9 ай бұрын
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.
@unicornminded3145
@unicornminded3145 2 жыл бұрын
thank you thank you!!!!
@MrJuicer7444
@MrJuicer7444 Ай бұрын
please make more senpai OwO
@richgoo
@richgoo 2 жыл бұрын
I think you say 'go ahead and' more than lumbergh. Useful though, thanks!!
@jeremycollum
@jeremycollum 3 жыл бұрын
Nicely explained and easy to follow. Just as a slight criticism, I found the background music a bit distracting.
@coralswank1479
@coralswank1479 3 жыл бұрын
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]
@mehmedkukavica8076
@mehmedkukavica8076 2 жыл бұрын
Seper!
@davidcooke285
@davidcooke285 4 жыл бұрын
I can print out all the rows to the screen but only the first 2 indexes to the file. do you have a forum I could post the code to for you assistance? Thanks
@scott_hull
@scott_hull 4 жыл бұрын
If you're following my tutorial, notice that in line 12 I only formatted in "Student First Name" and "Student Last Name". Just replicate the curly braces 2 more times and add in the other 2 index values to the format function.
@joanaguarin9550
@joanaguarin9550 3 жыл бұрын
How do you parse a csv without hardcoding the filename? like assigning command line arguments to variables in python
@scott_hull
@scott_hull 3 жыл бұрын
Look into the argparse Python library.
@rapidretrovenue563
@rapidretrovenue563 2 жыл бұрын
alot of these videos that go over the cvs reader are nice but perplex me in that they never go over the default location in which the csv reader reads from or how to adjust it.
@Schnikle_fritz
@Schnikle_fritz 3 жыл бұрын
What if I wanted to write each entry in a particular column to a separate .txt file? Like, each entry gets its own .txt and all the written .txt files get saved in one folder.
@scott_hull
@scott_hull 3 жыл бұрын
You'll need to position code for that within your row-by-row for loop where you use the standard Python open function, give the file a unique name, write to it, and then close it. Maybe I'll try that in a future video.
@Schnikle_fritz
@Schnikle_fritz 3 жыл бұрын
@@scott_hull Thank you so much!! That would be awesome!!
@moviesfun9898
@moviesfun9898 2 жыл бұрын
Bro can you please help me I have a simple csv file containing name age and DOB And task is just to validate the csv file as below condition Check if the file is empty or not -Names should be String -Age should be Integer ...should not be more than 2 digits....should not be negative -Dob should be of Date time format....Dob should not be a future date.... format should be like this 10/01/1999 only If csv row conditions are satisfied then Create and send correct row to the Correct.csv Else if data is wrong such as illigal date format or integer length is more then 2 digit or something like that then just create a new csv name error.csv and send row to error.csv
@lampmanjosh
@lampmanjosh 3 жыл бұрын
What program are you using here? I'm on Windows.
@scott_hull
@scott_hull 3 жыл бұрын
PyCharm Professional Edition…there is a free community edition though.
@mabd7340
@mabd7340 3 жыл бұрын
What does parsing a file mean?
@keyurbhavsar2847
@keyurbhavsar2847 Жыл бұрын
Suggestion: Content is good but ...Do Not add Music ....Its annoying
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 53 МЛН
路飞做的坏事被拆穿了 #路飞#海贼王
00:41
路飞与唐舞桐
Рет қаралды 25 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 142 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 37 МЛН
List Comprehension - BEST Python feature !!! Fast and Efficient
14:51
Python Simplified
Рет қаралды 198 М.
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,7 МЛН
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 334 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 406 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 229 М.
Learn HOW to Read CSV Files in Python!
6:35
Earthly
Рет қаралды 16 М.
Python CSV files - with PANDAS
7:59
John Watson Rooney
Рет қаралды 112 М.
15 POWERFUL Python Libraries You Should Be Using
22:31
ArjanCodes
Рет қаралды 61 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 53 МЛН