Pandas > Select rows using function

Name
Code
Output
dataframe = pandas.DataFrame(numpy.random.randint(0,10,size=(5, 3)), columns=['C1','C2','C3'])
print ("dataframe")
print (dataframe)
# select elements with even index number
dataframe2 = dataframe.select(lambda x: x%2==0)
print ("dataframe selected items")
print (dataframe2)
dataframe
   C1  C2  C3
0   5   6   0
1   1   2   0
2   9   1   7
3   6   2   7
4   0   7   9
dataframe selected items
   C1  C2  C3
4   0   7   9