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: makunadata@gmail.com
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, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 223 раз и оно понравилось 8 зрителям. Приятного просмотра!