Skip to content

Instantly share code, notes, and snippets.

@talonsensei
Created July 25, 2013 17:32
Show Gist options
  • Save talonsensei/6081973 to your computer and use it in GitHub Desktop.
Save talonsensei/6081973 to your computer and use it in GitHub Desktop.
How to subset RPy2 data frames by single or multiple criteria
# By single criteria
subset_frame = dataframe.rx(dataframe.rx2('input_type').ro == 'VALUE', True)
# By Multiple Criteria
subset_frame = all_data_frame.rx((dataframe.rx2('input_type').ro == 'VALUE1').ro &
(dataframe.rx2('data_type').ro == 'VALUE2'), True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment