I have the following dataframe which is list of races and results.
Date R H Fin Win
0 11182017 1 1 2 0
1 11182017 1 2 1 5
2 11182017 1 3 3 0
3 11182017 2 1 2 0
4 11182017 2 2 1 10
5 11182017 3 1 1 6
6 11182017 3 2 2 0
I want to be able to filter first by race (R) then by horse (H) and return the results.
For the dataset above when R = 1 I want to see only H 1 & 2 (ie filter out H 3 for R 1). For R = 2 I want to to see only H 1 (ie filter out H 2 for R 2) and for R =3 I only want to see H 2 (ie filter out H 1 for R 3). I would accomplish this by setting a variable preferably via a prompt. Essentially I am trying to "scratch" certain horses from a particular race
Results Example below
Date R H Fin Win
0 11182017 1 1 2 0
1 11182017 1 2 1 5
3 11182017 2 1 2 0
6 11182017 3 2 2 0
Ris race. But what is Horse? Couldn't see the why # 1 and 2 would be returned forR=1and #1 forR=2Rand forHand you'd return the new data frame?