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
En esta página del sitio puede ver el video en línea Solving Python Data Analysis Interview Questions - Airbnb de Duración hora minuto segunda en buena calidad , que subió el usuario MaKuData 26 noviembre 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 223 veces y le gustó 8 a los espectadores. Disfruta viendo!