From bd1c9ea6520e4ee38a458679746a6fdc25523c4e Mon Sep 17 00:00:00 2001 From: suhanasahu Date: Wed, 8 Oct 2025 23:00:32 +0530 Subject: [PATCH] assign1 --- Suhana-240109475/assign1.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Suhana-240109475/assign1.py diff --git a/Suhana-240109475/assign1.py b/Suhana-240109475/assign1.py new file mode 100644 index 0000000..c009269 --- /dev/null +++ b/Suhana-240109475/assign1.py @@ -0,0 +1,34 @@ +import pandas as pd +import numpy as np +import statistics as stat +import matplotlib.pyplot as plt +dataframe = pd.read_csv("C:/Users/suhan/OneDrive/Desktop/ml workshop/dataset/iris.csv", + names=["Sepal Length", "Sepal Width", "Petal Length", "Petal Width", "Class"]) + +print(dataframe.head()) +petal_length = dataframe["Petal Length"] +print("MEAN =", stat.mean(petal_length)) +print("MODE =", stat.mode(petal_length)) +print("MEDIAN =", stat.median(petal_length)) +mean = np.mean(petal_length) +std = np.std(petal_length) + +dataframe_null=dataframe.isnull() +dataframe_not_null=dataframe.dropna(axis=0) +print(dataframe_not_null) + +randarray=np.random.randn(1000) +np.random.normal() + +plt.hist(randarray,bins=100) +plt.title("Normal Distribution") +plt.xlabel("Time") +plt.ylabel("Amplitude") +plt.show() + + +correlation = dataframe.corr(numeric_only=True) +print("\nCORRELATION MATRIX:\n", correlation) + +covariance = dataframe.cov(numeric_only=True) +print("\nCOVARIANCE MATRIX:\n", covariance)