Skip to content

Instantly share code, notes, and snippets.

@talonsensei
Created July 25, 2013 17:32
Show Gist options
  • Select an option

  • Save talonsensei/6081973 to your computer and use it in GitHub Desktop.

Select an option

Save talonsensei/6081973 to your computer and use it in GitHub Desktop.

Revisions

  1. talonsensei created this gist Jul 25, 2013.
    6 changes: 6 additions & 0 deletions Subset RPy2 dataframes
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # 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)