Skip to content

Instantly share code, notes, and snippets.

@joseberlines
Created February 21, 2021 23:29
Show Gist options
  • Save joseberlines/110e69e6b4566155f7feb263339f940c to your computer and use it in GitHub Desktop.
Save joseberlines/110e69e6b4566155f7feb263339f940c to your computer and use it in GitHub Desktop.
rail_lines = [{'id': 'line1', 'source': 'BER', 'target': 'MUN', 'speed': '200km/h'},
{'id': 'line2', 'source': 'MUN', 'target': 'FRA', 'speed': '200km/h'},
{'id': 'line3', 'source': 'FRA', 'target': 'BER', 'speed': '250km/h'},
{'id': 'line4', 'source': 'BER', 'target': 'HAM', 'speed': '300km/h'},
{'id': 'line5', 'source': 'BER', 'target': 'LEP', 'speed': '300km/h'},
{'id': 'line6', 'source': 'NUR', 'target': 'LEP', 'speed': '150km/h'},
{'id': 'line7', 'source': 'NUR', 'target': 'FRA', 'speed': '150km/h'},
{'id': 'line8', 'source': 'BER', 'target': 'PAR', 'speed': '400km/h'},
{'id': 'line9', 'source': 'PAR', 'target': 'LYO', 'speed': '400km/h'},
{'id': 'line10', 'source': 'LYO', 'target': 'BAR', 'speed': '400km/h'},
{'id': 'line11', 'source': 'LYO', 'target': 'MIL', 'speed': '200km/h'}]
rails_df = pd.DataFrame(rail_lines,columns=['id','source','target','speed'])
rails_df['label'] = rails_df['speed']
rails_df['background-color'] = 'black'
rails_df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment