Python Pandas Explode Columns Tutorial

preview_player
Показать описание
Today we are taking a look at how you can apply the explode function to a column within a Python Pandas Dataframe

Dataframe Code:
df = pd.DataFrame({ 'card': ['1971 Nolan Ryan', '1928 Ogden Don Bradman', '1909 T206 Ty Cobb', '1887 Lone Jack Ben Franklin', '2005 Topps Justin Verlander'],
'properties': [['Baseball', 'Vintage', 'Pitcher'], ['Cricket', 'Pre War'], ['Baseball', 'Pre War', 'Batter'], ['Non Sports', 'Pre War'], ['Baseball', 'Modern', 'Pitcher']]
})

Interested in discussing a Data or AI project? Feel free to reach out via email or simply complete the contact form on my website.

🍿 WATCH NEXT

MY OTHER SOCIALS:

WHO AM I?
As a full-time data analyst/scientist at a fintech company specializing in combating fraud within underwriting and risk, I've transitioned from my background in Electrical Engineering to pursue my true passion: data. In this dynamic field, I've discovered a profound interest in leveraging data analytics to address complex challenges in the financial sector.

This YouTube channel serves as both a platform for sharing knowledge and a personal journey of continuous learning. With a commitment to growth, I aim to expand my skill set by publishing 2 to 3 new videos each week, delving into various aspects of data analytics/science and Artificial Intelligence. Join me on this exciting journey as we explore the endless possibilities of data together.

*This is an affiliate program. I may receive a small portion of the final sale at no extra cost to you.
Рекомендации по теме
Комментарии
Автор

Awesome explanation ...just 1 suggestion - instead of df.head() use df.sample(10) to get random rows ...gives a better idea about the dataset

bubblebath
Автор

@Ryan Nolan: Great video. I have a question, whether we should use 'loc' or 'query' method to filter out the data, which is better and why? I was using 'loc' method because it gives me flexibility to have columns of my choice. Please advise. Thank you.

Al-Ahdal
Автор

Nice, you just gained a new suscriber

juanbertone
Автор

How about if u have two columns u want to explode simultaneously ?

hjiraoussama