I want to create a new dataframe from existing dataframe based on a condition.
df1=>
id1 id2
11 i
11 k
20 l
20 m
20 n
31 k
31 j
Here if id2 in df1 is greater than k alphabetically then the new data frame df2 should be like shown below:
df2=>
id1 id2
11 0
20 1
31 0