-2

This is Korean basketball player's stats in 2011.

1

I need the list of players who have more than 55% of 2-point shot percentage. So I made a code like this and it doesn't work

2

it gives me this error

ValueError from pandas\core\generic.py in nonzero(self)

The truth value of a Series is ambiguous. Usse a.empty(), a.bool(), a.item(), a.any() or a.all().

Patrick Artner
  • 50,409
  • 9
  • 43
  • 69
sunu0618
  • 3
  • 2

1 Answers1

2

Just create a new DataFrame using df.loc:

import pandas as pd
df = pd.read_excel('filepath')
df = df.loc[df['Average 2-point %'] > 55]]
pstatix
  • 3,611
  • 4
  • 18
  • 40