pythonpandaseda

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


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


Solution

  • You can try this :

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