Q:

Write a Python program to get observations of each species (setosa, versicolor, virginica) from iris data

0

Write a Python program to get observations of each species (setosa, versicolor, virginica) from iris data.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import pandas as pd
data = pd.read_csv("iris.csv")
print("Observations of each species:")
print(data['Species'].value_counts()) 

Sample Output:

Observations of each species:
Iris-versicolor    50
Iris-virginica     50
Iris-setosa        50
Name: Species, dtype: int64

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now