Python For & While Loops for Data Science / Data Analysis - P.3

preview_player
Показать описание
(My recommended courses that I took to learn Python!)

This video provides and overview of how loops (for and while) are used by data scientist and data analysts. In this tutorial we take time to cover for and while loops and how they are used with different built in functions such as: range(), enumerate(), & .items(). Additionally, we cover loop control statements: break, continue, pass. Finally, we combine what we learned to analyze the script from the popular TV show "The Office" to find lines that contain: That's what she said.

00:00 Intro
00:41 For Loops - The basics
02:08 For Loops - range() function
03:07 For Loops - Iterating over objects
03:53 For Loops - Iterating over a dictionary
06:10 For Loops - enumerate() function
08:01 While Loops - The basics
09:20 While Loops - More complex
10:17 Loop Control Statements - break
11:43 Loop Control Statements - continue
12:29 Loop Control Statements - pass
13:02 Application: Analyzing "The Office" script
14:54 Application: Read the CSV
17:04 Application: Insert Column from CSV in list
19:42 Application: Find "That's what she said"
22:50 Conclusion

Recommended Certificates/Courses (Affiliate Links)
==================================
DataCamp:

Coursera:

My Tech for Data Science
(Includes Amazon Affiliate Links)
==================================

Social Media / Contact Me
======================

As an Amazon Associate, I earn a small commission from qualifying purchases on the Amazon links above. It costs you nothing but helps me in keeping the content coming.

#pythontutorial #datavisualization #python
Рекомендации по теме
Комментарии
Автор

Not only was this a thorough explanation of the concept but the content was also engaging, love The Office. Thanks!

ArthurBotis
Автор

This content u provide is insane, you have no idea how many people you've helped with this. Thanks man!!

vish
Автор

I only recently started learning python and loop was one of many things that I didn't quite understand. This video IS the one the gave me "AHA" moment and now it all makes sense. You have a way to explain difficult things in a simple way. Keep up the good work!

我喜欢吃咖啡
Автор

Love the way you implement Python to a well-known sitcom, makes learning process much more entertaining.
I shall take "Parks and Recreation" script and do some similar stuff in order to sustain new aquired skills.
Thank you!

ccururs
Автор

Ever since I came across your channel, I've become extremely interested in DATA science. Really great content. Keep it up!. Hoping that your channel grows into something big!!

ilyan
Автор

Many thanks luke :), so great contain, no place to next video...

aissamboudra
Автор

this helps! very nicely explained. thank you!

fatimak
Автор

Where did the "previous_item" come from. You didn't tell Python that "previous_item" was the line before the condition, so how did it know that "previous_item" was... the previous item.

joeyditizii
Автор

HI Luke, I have a question. "for row in csvreader": row is a variable right? Thank you.

juanpaoloyt
Автор

Good content, are you planning for pandas and numpy videos?

negisaab
Автор

I didn't get it when you assigned the previous_item to the item. Can you share how you defined previous_item

pindbramptonOntario
Автор

Wondering what interface you're using? It says Jupyter server but it doesnt 'look' like JupyterNotebook or JupyterLab.

fatimak
Автор

As always top-notch quality from Master Luke DataWalker :)

Quick question please! At 22:00, how exactly does the "previous_item" variable work properly?

When the condition initializes the item that matches the condition is (let's say) at position X in the list. How on science's green earth, we do retrieve the X - 1 position? (meaning with pull the sentence before our condition statement?)

I presume when the [for statement] takes takes effect the [item] is in X - 1 position (i.e. previous sentence), and it is only when the nested [if statement] takes effect that the [item] receives the position required by our condition?

Thank you!

jimpauls
Автор

Hey Luke! First of all, thank you for sharing your knowledge. I wanted to ask you, in the last episode of this video you create the variable 'previous_item' and it's = item, I don't understand how it returns the previous line, aren't you asking to 'previous_item' to be equal to item?

alexis.jacobo.drums
Автор

I made a bot that tells me the age of the person in my family when I insert a name...it's the most useless thing ever yet I've never been more proud!

paulbuono
Автор

Hello Luke, when I execute the commands to obtain the list of all lines (in your tutorial you run those command at minute 19:35), unfortunately the first line that comes out is from episode 3 ("Good luck. [closes door and locks it]"). :( :( I tried and tried to understand why, but without success. Where does this issue come from? Thanks in advance...

adfbi