your recipe card header background

    iris

    0

    0

    Ananya Singh

    Number of distinct values in class label column = 21 Name of distinct species = ["Cabomba caroliniana","Camellia sinensis","Iris spp.","Lilium spp.

    Library: numpy

    import pandas as pd
    iris=pd.read_csv('Iris.csv')
    iris.head()
    iris.describe()
    print(iris)
    #int some random rows
    random_of_dataset = iris.sample(5)
    print("\n Random rows from the dataset:\n ",random_of_dataset)
    
    #Delete ID column
    iris.pop('Id')
    print("\nCSV Data after deleting the column 'Id':\n")
    print(iris)
    
    #Show the use of loc,iloc
    print(iris.loc[:,'SepalWidthCm'])
    print(iris.iloc[0:5])
    
    Total = iris['SepalWidthCm'].sum()
    print("Sum of Sepal Width = ",Total)
    
    Total = iris['SepalLengthCm'].sum()
    print("Sum of Sepal Lenght = ",Total)
    
    Total = iris['PetalLengthCm'].sum()
    print("Sum of Petal Lenght = ",Total)
    
    Total = iris['PetalWidthCm'].sum()
    print("Sum of Petal Width = ",Total)
    
    Mean=iris['SepalLengthCm'].mean()
    print("Mean of Sepal Lenght = ",Mean)
    
    Mean=iris['SepalWidthCm'].mean()
    print("Mean of Sepal Width = ",Mean)
    
    Mean=iris['PetalLengthCm'].mean()
    print("Mean of Petal Width = ",Mean)
    
    Mean=iris['PetalWidthCm'].mean()
    print("Mean of Petal Width = ",Mean)
    
    Median=iris['SepalWidthCm'].median()
    print("Median of Sepal Width = ",Median)
    
    Median=iris['SepalLengthCm'].median()
    print("Median of Sepal Length = ",Median)
    
    Median=iris['PetalWidthCm'].median()
    print("Median of Petal Width = ",Median)
    
    types_of_species = iris["Species"].unique()
    n = len(pd.unique(iris['Species']))
    print("Number of distinct values in class label column = ",n)
    print("Name of distinct species = ",types_of_species)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.