I am trying to currently using the Iris classification dataset with Python and Pandas to do some data analysis. I'm trying to print all the petal-length values that are greater than 1.7 and where the data species is Setosa but I'm having a problem.
I keep getting this error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Here is my code:
iris = pd.read_csv(r"C:\Users\username\Downloads\iris.csv")
for row in iris:
if iris["species"] == "setosa":
if iris["petal_width"] > 1.7:
print(iris["petal_width"])
Any help or suggestions you can give me I would greatly appreciate it. Thank you!