ML2 NDassignment
ML2 NDassignment
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
tb = pd.read_csv('ML2.csv')
tb.head()
#QUES 1 (A)-> Draw and compare histograms of these two groups of tumor
data (Data1(LG) and Data2(HG)).
# Extract the tumor data
data1_lg = ['Data-1 (LG)']
_
data2_hg = ['Data2 (HG)']
<Axes: >
#The box plot for LG tumors shows a smaller range with fewer outliers,
indicating lower variability in tumor sizes.
#The box plot for HG tumors, on the other hand, displays a wider
range, highlighting greater variability in the sizes
Mean: 11.4
# (ii) Median
median_value = np.median(user_list)
print("Median:", median_value)
Median: 7.5
# (iii) Mode
try:
mode_value = stats.mode(user_list)
print("Mode:", mode_value)
except stats.StatisticsError:
print("No mode found, all values appear only once.")
Mode: 10
# (iv) Variance
variance_value = np.var(user_list)
print("Variance:", variance_value)
Variance: 144.84