Home > Blockchain >  I want to only those names who are having value count > 15 but its giving true and false for all
I want to only those names who are having value count > 15 but its giving true and false for all

Time:11-28

df['player_of_match'].value_counts()>15 

i am getting this output

CH Gayle           True
AB de Villiers     True
MS Dhoni           True

                  ... 
BA Bhatt          False
WPUJC Vaas        False
AD Mascarenhas    False

when I am using this code then I am getting :

df['player_of_match'].value_counts()
CH Gayle          21
AB de Villiers    20
MS Dhoni          17
                  ..

BA Bhatt           1
WPUJC Vaas         1
AD Mascarenhas     1

But I just want names having count > 15. Please help me in putting conditions. P.S. new here

CodePudding user response:

Try:

df[df['player_of_match'].value_counts()>15] 

CodePudding user response:

You can try this :

df['player_of_match'].value_counts()[df['player_of_match'].value_counts() > 15]

  • Related