Skip to content

Instantly share code, notes, and snippets.

@simboli
Created March 21, 2020 00:13
Show Gist options
  • Save simboli/5cd455f203aab5038c4832a45c4fa43a to your computer and use it in GitHub Desktop.
Save simboli/5cd455f203aab5038c4832a45c4fa43a to your computer and use it in GitHub Desktop.
# Number of ring trips % (per user_type)
round_trips=df_trip_stations['count'].loc[df_trip_stations['idplug_station']==df_trip_stations['idunplug_station']].groupby(df_trip_stations['user_type']).sum()
total_trips=df_trip_stations['count'].groupby(df_trip_stations['user_type']).sum()
round_trips.div(total_trips)*100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment