How do I iterate two sets of array with two different conditions? I am using iris data and trying to classify if it is versicolour or vigrinica.
array = dataframe.values
petalLength = array[50:,2]
petalWidth = array[50:,3]
I'm trying to iterate two arrays, but not getting the results I need.
def decision(petalLength, petalWidth):
for x in petalLength:
for y in petalWidth:
if x < 4.8 and y < 1.8:
print("Versicolour")
else:
print("Virginica")
Results for example:
petal Length is 4.7 and petal Width is 1.5 the answer should be Versicolour
petal Length is 4.7 and petal width is 1.9 the answer should be Virginica