Skip to content

Instantly share code, notes, and snippets.

@joseberlines
Created February 21, 2021 23:04
Show Gist options
  • Save joseberlines/bccefde3394dfe1060cfb7cf94d62e61 to your computer and use it in GitHub Desktop.
Save joseberlines/bccefde3394dfe1060cfb7cf94d62e61 to your computer and use it in GitHub Desktop.
rails_df['high-speed'] = rails_df.apply(lambda x: [x.target,x.source] if x.speed in ['400km/h'] else [], axis=1)
rails_df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment