Pandas > Select data using condition in list

Name
Code
Output
dataframe = pandas.DataFrame(numpy.random.randint(0,10,size=(5, 3)), columns=['C1','C2','C3'])
print ("dataframe")
print (dataframe)
dataframe2 = dataframe.loc[dataframe.C1.isin([1,2,3])]
print ("dataframe selected columns")
print (dataframe2)
dataframe
   C1  C2  C3
0   8   0   4
1   2   0   5
2   5   4   5
3   6   4   1
4   3   5   9
dataframe selected columns
   C1  C2  C3
1   2   0   5
4   3   5   9