I have a csv file pInfo.csv
id,state,rank,amount,area
74,GA,Bronze,298.62,7
263,FL,Diamond,421.43,60
33,IL,Silver,361.69,5
I am using pandas to try and write only all the files that contain rank of Silver to a new file.
So something like
df = pd.read_csv("pInfo.csv")
if df['rank'].values == "Silver":
df.to_csv('newInfo.csv')
I get an error "The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
This is my first time working with pandas so any help or approach is appreciated.