19 Must-Know Techniques to Create Pandas DataFrames (with Examples!)
Ryan & Matt Data Science
0:00 / 0:00
19 Must-Know Techniques to Create Pandas DataFrames (with Examples!)
868 просмотров · 1 год назад
Ryan & Matt Data Science
46,2 тыс. подписчиков
868 просмотров · 1 год назад
🧠 Don’t miss out! Get FREE access to my Skool community — packed with resources, tools, and support to help you with Data, Machine Learning, and AI Automations! 📈 https://www.skool.com/data-and-ai-aut...
In this Python Pandas tutorial we will go over different approaches to creating dataframes in Pandas. This covers lists, to excel or csv files to JSON. The Python code will be down below
Code: https://ryanandmattdatascience.com/pa...
🚀 Hire me for Data Work: https://ryanandmattdatascience.com/da...
👨💻 Mentorships: https://ryanandmattdatascience.com/me...
📧 Email: ryannolandata@gmail.com
🌐 Website & Blog: https://ryanandmattdatascience.com/
🖥️ Discord: / discord
📚 *Practice SQL & Python Interview Questions: https://stratascratch.com/?via=ryan
📖 *SQL and Python Courses: https://datacamp.pxf.io/XYD7Qg
🍿 WATCH NEXT
Python Pandas Playlist: • Python Pandas for Beginners
19 Ways to Create a Pandas DataFrame in Python | Complete Tutorial
In this video, I walk through 19 different ways to create a pandas DataFrame in Python, covering everything from basic methods to more advanced techniques. We start with simple approaches like creating DataFrames from lists and dictionaries, then move into working with tuples, series, and multiple data structures combined. I show you how to read in data from external files including CSV, Excel, and JSON formats, which are some of the most common ways you'll work with DataFrames in real projects.
We also explore more advanced methods like creating DataFrames row by row, using numpy arrays, working with custom indexes, and even pulling data from SQL queries. Throughout the video, I use practical examples with real code that you can follow along with, and I explain why certain methods are more useful than others based on my experience. By the end of this tutorial, you'll understand all the main ways to create pandas DataFrames and know which approach to use for different situations.
Whether you're just starting with pandas or looking to expand your data manipulation skills, this comprehensive guide covers the essential techniques you need. All the code from this video is available on my website—link in the description below.
TIMESTAMPS
00:00 Introduction to Creating Pandas DataFrames
01:02 Creating DataFrame from a Simple List
02:01 Creating DataFrame from Multiple Lists
03:17 Creating DataFrame from Dictionary
05:00 Creating DataFrame from Series in Dictionary
06:05 Creating DataFrame from Tuples
07:19 Creating DataFrame from List of Dictionaries
08:09 Creating DataFrame from Two Lists
09:20 Creating DataFrame from Series
10:20 Creating DataFrame from Multiple Series
12:28 Reading CSV and Excel Files
13:40 Reading JSON Files and JSON Strings
16:02 Creating DataFrame with Custom Index
18:20 Creating DataFrame from Columns of Another DataFrame
19:40 Creating DataFrame Row by Row (Method 1)
21:00 Creating DataFrame Row by Row (Method 2)
22:40 Creating DataFrame from Numpy Array
24:05 Creating DataFrame from SQL Query
25:39 Most Common Methods Recap
OTHER SOCIALS:
Ryan’s LinkedIn: / ryan-p-nolan
Matt’s LinkedIn: / matt-payne-ceo
Twitter/X: https://x.com/RyanMattDS
Who is Ryan
Ryan is a Data Scientist at a fintech company, where he focuses on fraud prevention in underwriting and risk. Before that, he worked as a Data Analyst at a tax software company. He holds a degree in Electrical Engineering from UCF.
Who is Matt
Matt is the founder of Width.ai, an AI and Machine Learning agency. Before starting his own company, he was a Machine Learning Engineer at Capital One.
*This is an affiliate program. We receive a small portion of the final sale at no extra cost to you.