Python For & While Loops for Data Science / Data Analysis - P.3 @LukeBarousse
Python For & While Loops for Data Science / Data Analysis - P.3  @LukeBarousse
Uploaded November 2020 | Updated September 2026, 7 hours ago
Python Fundamentals Course (DataCamp) ๐Ÿ‘‰๐Ÿผ lukeb.co/PythonBasicsDataCamp
Data Analyst Track w/ Python (DataCamp) ๐Ÿ‘‰๐Ÿผ lukeb.co/PythonAnalystDataCamp
(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.

Playlist (Course) Material ๐Ÿ‘‰๐Ÿผ github.com/lukebarousse/Python_Intro

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

Basics of Python playlist ๐Ÿ‘‰๐Ÿผ youtube.com/playlist?list=PL_CkpxkuPiT8zTx9XO9jFf4PQ0iwBWfXB

Setting up Python on your computer playlist ๐Ÿ‘‰๐Ÿผ youtube.com/playlist?list=PL_CkpxkuPiT9udgCeqZpS4HKF6uIzra3r

Recommended Certificates/Courses (Affiliate Links)
==================================
DataCamp:
Python ๐Ÿ‘‰๐Ÿผ lukeb.co/PythonBasicsDataCamp
Power BI ๐Ÿ‘‰๐Ÿผ lukeb.co/PowerBIDataCamp
Tableau ๐Ÿ‘‰๐Ÿผ lukeb.co/TableauDataCamp
R ๐Ÿ‘‰๐Ÿผ lukeb.co/RDataCamp
Data Analyst w/ Python ๐Ÿ‘‰๐Ÿผ lukeb.co/PythonAnalystDataCamp
DataCamp Subscription (Monthly $25USD) ๐Ÿ‘‰๐Ÿผ lukeb.co/DataCampSub

Coursera:
Google Data Analytics Certificate (BEGINNERS START HERE) ๐Ÿ‘‰๐Ÿผ lukeb.co/GoogleCert
Python for Everybody ๐Ÿ‘‰๐Ÿผ lukeb.co/PythonForEverybody
SQL ๐Ÿ‘‰๐Ÿผ lukeb.co/PostgresSQLUofM
Coursera Plus Subscription (Monthly $59USD) ๐Ÿ‘‰๐Ÿผ lukeb.co/CourseraMonthly
Coursera Plus Subscription (Annual $399USD) ๐Ÿ‘‰๐Ÿผ lukeb.co/CourseraYearly

My Tech for Data Science
(Includes Amazon Affiliate Links)
==================================
๐Ÿ’ป Dell New XPS 13 (PC of choice) ๐Ÿ‘‰๐Ÿผ geni.us/DellNewXPS13
๐Ÿ’ป Dell New XPS 15 ๐Ÿ‘‰๐Ÿผ geni.us/DellNewXPS15
๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป M1 Macbook Air 8GB (Mac of choice) ๐Ÿ‘‰๐Ÿผ geni.us/M1macAir8GB
๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป M1 Macbook Pro 8GB ๐Ÿ‘‰๐Ÿผ geni.us/M1macPro8GB
๐Ÿ”Œ Must-have Mac dock ๐Ÿ‘‰๐Ÿผ geni.us/CalDigitTS3
๐Ÿ–ฅ M1 Multiple monitor adapter ๐Ÿ‘‰๐Ÿผ geni.us/DisplayLinkAdapter
โŒจ๏ธ Mac Keyboard ๐Ÿ‘‰๐Ÿผ geni.us/MacMagicKeyboard
๐Ÿ–ฑ Mac Mouse ๐Ÿ‘‰๐Ÿผ geni.us/MacMagicMouse
๐Ÿ’พ Small (1TB) External HD ๐Ÿ‘‰๐Ÿผ geni.us/WDelements1TB
๐Ÿ’พ Large (14TB) External HD ๐Ÿ‘‰๐Ÿผ geni.us/WDelements14TB
๐Ÿข Standing Desk ๐Ÿ‘‰๐Ÿผ geni.us/StandingDeskFezibo
๐Ÿ“— Data Science Must Read ๐Ÿ‘‰๐Ÿผ geni.us/StorytellingWithData
๐Ÿ“ธ Camera of Choice ๐Ÿ‘‰๐Ÿผ geni.us/SonyA6600body
*For computers, I recommend checking the manufacturer's website (i.e., dell.com) for deals/rebates*

Social Media / Contact Me
======================
๐Ÿ™‹๐Ÿผโ€โ™‚๏ธWebsite: lukebarousse.com
๐ŸŒ„ Instagram: instagram.com/lukebarousse
โฐ TikTok: tiktok.com/@lukebarousse
๐Ÿ“˜ Facebook: facebook.com/datavizbyluke
๐Ÿ“ฅ Business Inquiries: luke@lukebarousse.com

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
Python For & While Loops for Data Science / Data Analysis - P.3How I learn Data Science as a Data Analyst ๐Ÿค“๐Ÿ“šConnect Google Sheets to Tableau & Joining Data - Tableau Tutorial P.1Non-Python Machine Learning Tools โŒ๐Ÿ๐Ÿค–SQL for Data Analytics โ€“ Intermediate Course + ProjectGoogleโ€™s BI vs. Advanced Data Analytics CertificatesHow I Would Learn to be a Data AnalystHow to get Data Analytics side jobs - NEW LinkedIn FeatureGemini is Here - Is this the End of ChatGPT?How I Learn ๐Ÿง Mac vs PC for Data Science (SPOILER: Dont get a Mac...)SQL for Data Engineering -  Full Course for Beginners
Luke Barousse |

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

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER