0

So I have a big dataframe with a column FundID. In this column is a number of FundIDs but i only want some of them. This value is not the index but I can make it the index if that is easier.

Currently I am using df.loc[] to select values in each column but I'm thinking there has to be a better way. Any suggestions?

 reader.loc[(reader['ABOR Fund ID']==770) | (reader['ABOR Fund ID']==113) | 
(reader['ABOR Fund ID']==127)|(reader['ABOR Fund ID']==533)|(reader['ABOR 
 Fund ID']==4094)|(reader['ABOR Fund ID']==79)|(reader['ABOR Fund 
 ID']==735)|(reader['ABOR Fund ID']==1684)|(reader['ABOR Fund ID']==91)| 
(reader['ABOR Fund ID']==1194)|(reader['ABOR Fund ID']==2015)|(reader['ABOR 
 Fund ID']==1530)|(reader['ABOR Fund ID']==72)|(reader['ABOR Fund 
ID']==737)|(reader['ABOR Fund ID']==738)|(reader['ABOR Fund ID']==628)]

1 Answers1

2

Try this

reader.loc[reader['ABOR Fund ID'].isin([values seperated by comma])]
Sachin
  • 359
  • 2
  • 18