Need to select only those rows where at least one value is present from the list.
I have tried to use isin
function as below but it's returning those rows also which don't have any value from the list:-
df[(df.loc[:,'P_1':'P_90'].isin(list))]
Note:-
P_1 to P_90
indicated range of columns. Sample data:- dib-cust_id|p_1|p_2|.......|p_90 345|1950|1860|..............|675Note:- I can't provide exact data as it's confidential. Above is just an example how dataframe will look like with 91 columns.
Please let me know what is wrong in this method and is there any other way to get the desired result.