Last active
February 21, 2021 23:17
-
-
Save joseberlines/10b0ac486d67a4aa3c2d6fd9c77ebb9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails_df['speed_int']=rails_df['speed'].str.replace('km/h','').astype('int') | |
min_speed = rails_df['speed_int'].min() | |
max_speed = rails_df['speed_int'].max() | |
span_speed = max_speed-min_speed | |
rails_df['score'] = rails_df['speed_int'].apply(lambda x: (x-min_speed)/span_speed) | |
rails_df['width'] = rails_df['score'] *7 +5 | |
G=transform_into_ipycytoscape(stations_df,rails_df) | |
display(G) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment