29- Pandas DataFrames: Pivoting and Creating Pivot Tables

preview_player
Показать описание
Visit my personal web-page for the Python code:
Рекомендации по теме
Комментарии
Автор

For those lazy to type:

raw_data = {
'city': ['Tripoli', 'Sydney', 'Tripoli', 'Rome', 'Rome', 'Tripoli', 'Rome', 'Sydney', 'Sydney'],
'rank': ['1st', '2nd', '1st', '2nd', '1st', '2nd', '1st', '2nd', '1st'],
'score1': [44, 48, 39, 41, 38, 44, 34, 54, 61],
'score2': [67, 63, 55, 70, 64, 77, 45, 66, 72]
}

df = pd.DataFrame(raw_data,
columns = ['city', 'rank', 'score1', 'score2'])
df

George-nehm
Автор

Awesome teaching!!
Great help you pasted the notebooks :)

hawardjoseph
Автор

Thanks for the vid!
I have two questions
1-what if you want to present only Rome data instead of all cities, how can you do it?
2-how to sort in a descending manner?

mostafaserag
Автор

It would be great if you include these notebooks in the description

seragsdks