adding stuff

pull/14/head
Aurian JAULT 10 months ago
parent f83f35c498
commit c1dfaa7b68

@ -3,10 +3,15 @@ import sys
sys.path.append('./src/back/')
import load_csv as l
import show_csv as s
df = l.return_csv("./data.csv")
l.csv_value(df)
l.csv_value(df)
l.csv_stadadisation_Z(df,"Vehicle Year")
# l.csv_stadardisation_Z(df,"Vehicle Year")
s.histo_col(df,"Speed Limit")
s.plotBoxWhisker(df)

@ -1,5 +1,6 @@
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def return_csv(path):
df = pd.read_csv(path)
@ -27,7 +28,7 @@ def csv_norm_min_max(df,col):
df[col] = (df[col] - df[col].min()) / (df[col].max() - df[col].min())
return df
def csv_stadadisation_Z(df,col):
def csv_stadardisation_Z(df,col):
mean_col1 = df[col].mean()
std_col1 = df[col].std()
df[col] = (df[col] - mean_col1) / std_col1

@ -0,0 +1,16 @@
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def histo_col(df,colonne):
plt.figure()
plt.hist(df[colonne], bins=int(df[colonne].nunique()/4), alpha=0.7, color='blue', edgecolor='black')
plt.title(f"Histogramme de la colonne '{colonne}'")
plt.xlabel(colonne)
plt.ylabel("Fréquence")
plt.grid(True)
plt.show()
def plotBoxWhisker(df):
df.plot(kind='box', subplots=True, sharex=False, sharey=False)
plt.show()
Loading…
Cancel
Save