I\'m trying to slice a dataframe based on list of values, how would I go about this?
Say I have an expression or a list l = [0,1,0,0,1,1,0,0,0,1]
l = [0,1,0,0,1,1,0,0,0,1]
Ho
Or maybe find the position of 1 in your list and slice from the Dataframe
list
Dataframe
df.loc[[i for i,x in enumerate(lst) if x == 1],:]