Python Pandas Dataframe Map Function Tutorial 19

Published: 01 November 2016
on channel: MyStudy
7,783
109

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 :

https://www.udemy.com/data-science-wi...

For All other visit my udemy profile at :

https://www.udemy.com/user/ankitmistry/


Watch video Python Pandas Dataframe Map Function Tutorial 19 online without registration, duration hours minute second in high quality. This video was added by user MyStudy 01 November 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,783 once and liked it 109 people.