Import modules

#import modules
import pandas as pd

Create a dataframe

#create a dataframe
data = {'name': ['Cristiano Ronaldo', 'Cristiano Ronaldo','Neymar','Kylian Mbappé','Erling Haaland','Léo Messi','Léo Messi','Karim Benzema'],
'age': [36,36, 29,22,20,33,33,33],
'height_cm': [187,187, 175,178,194,170,170, 187],
'club': ['Juventus FC','Juventus FC', 'Paris Saint Germain','Paris Saint Germain','Borussia Dortmund','FC Barcelona','FC Barcelona', 'Real Madrid'],
'country': ['Portugal','Portugal', 'Brazil','France','Norway','Argentina','Argentina','France']}
df = pd.DataFrame(data)
df
 
 nameageheight_cmclubcountry
0Cristiano Ronaldo36187Juventus FCPortugal
1Cristiano Ronaldo36187Juventus FCPortugal
2Neymar29175Paris Saint GermainBrazil
3Kylian Mbappé22178Paris Saint GermainFrance
4Erling Haaland20194Borussia DortmundNorway
5Léo Messi33170FC BarcelonaArgentina
6Léo Messi33170FC BarcelonaArgentina
7Karim Benzema33187Real MadridFrance
Looking for a job?
Join 5,000+ subscribers
No commitment. Cancel anytime.