Zwischenstand

This commit is contained in:
dev weycloud
2021-11-27 14:20:55 +01:00
parent ea08ba9b18
commit b3e4a699e4
4 changed files with 177 additions and 79 deletions

25
Vorlesung 6/autos.py Normal file
View File

@@ -0,0 +1,25 @@
import os
import pandas as pd
import openpyxl
from scipy import stats
# location will help to open files in the same directory as the py-script
__location__ = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
df = pd.read_csv(__location__ + '/autos.txt', sep=";")
df = df[:12]
print(df)
mw = df.mean()
print(mw)
sta = df.std()
print(sta)
analysis = pd.DataFrame({"Mittelwert": mw, "Standardabw.": sta})
print(analysis)
analysis.to_excel(__location__ + "/auswertung.xlsx")
corr = stats.pearsonr(df["Weight"], df["Volume"])
print("Corr:", corr)