To filter dataframe rows if value in column is in a set list of values with Python Pandas, we can use the isin
method.
For instance, we write
rpt[rpt['STK_ID'].isin(stk_list)]
to call isin
to get the STK_ID
values that are in the stk_list
list and return it.