Solving Python Data Analysis Interview Questions - Airbnb

Опубликовано: 26 Ноябрь 2023
на канале: MaKuData
98
7

In this series, I will be solving python data analysis interview questions in Stratascratch. In this particular video, I'm solving Google's interview question.

If you have any questions or feedback regarding this content, please let me know in the comments or you can contact me directly via email: [email protected]

My solutions to the mentioned questions are:
City With Most Amenities:
df = airbnb_search_details[['city', 'amenities']]
df['n_amenities'] = df['amenities'].apply(lambda x: len(x.split(',')))
df = df.groupby('city', as_index = False)['n_amenities'].sum().sort_values('n_amenities', ascending = False)
df.head(1)['city']

Ranking Most Active Guests:
df = airbnb_contacts[['id_guest', 'n_messages']]
df = df.groupby('id_guest', as_index = False)['n_messages'].sum().sort_values('n_messages', ascending = False)
df['rank'] = df['n_messages'].rank(ascending = False, method = 'dense')
df

Try out Stratascratch: https://stratascratch.com/?via=marius

Timestamps:
0:00 City With Most Amenities
6:40 Ranking Most Active Guests


Смотрите видео Solving Python Data Analysis Interview Questions - Airbnb онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь MaKuData 26 Ноябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 98 раз и оно понравилось 7 людям.