Python Pandas Dataframe Map Function Tutorial 19

preview_player
Показать описание
This tutorial will explain map function of dataframe object with 3 different use cases.

Map: It iterates over each element

1. Map dictionary object to one column
df["country"] = df["city"].map(city_to_country)

2. Map first_name to new firrst_name
df["new_first_name"] = df["first_name"].map(lambda x : "new_"+x)

3. Map age to new Age
df["new_age"] = df["age"].map(lambda x : 10+x)

Visit complete course on Data Science with Python :

For All other visit my udemy profile at :

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

Thank you! I've spent hours searching for a solution like this.

andreasmith
Автор

Great video! Your channel is really underappreciated!

jamz
Автор

Thank you. I know there are just a few lines of data and similarly a couple of lines of code but it would have been nice to have them downloadable. Anyway, I gave you a thumbs up.

expat
Автор

Thanks - Clear & concise example. Just what I was after.

Analyse_Us_Consulting
welcome to shbcf.ru