Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise5 5 #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions exercise5/A5.5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
application for solving Exercise 5.5
"""
import math
import scipy.stats

import pandas


def main(filepath, datasetname):
"""
main application
"""
dataframe = pandas.read_csv(filepath)
dataframe["FLOPS"] = dataframe["FLOPS"].apply(lambda x: math.log10(x))
print(f"\n=== Exercise a) {datasetname} ===")
correlation_efficiency, p_value = scipy.stats.pearsonr(dataframe["Jahr"], dataframe["FLOPS"])
print(f"Korrelationseffizient: {correlation_efficiency}")


if __name__ == "__main__":
main("./data/GrosseKisten.csv", "Große Kisten")
main("./data/Prozessoren.csv", "Prozessoren")
15 changes: 15 additions & 0 deletions exercise5/data/GrosseKisten.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Jahr,FLOPS,Rechner
1941,0.3,Zuse Z3
1950,682,Univac 1101
1956,10670,IBM 704
1959,97350,IBM 7090
1961,371700,IBM 7030
1969,3.30E+06,CDC 7600
1976,1.10E+08,Cray-1S
1985,1.22E+09,Cray-2s/4-128
1990,2.32E+10,NEC SX-3/44
1996,1.06E+12,Intel ASCI Red
2002,3.59E+13,NEC Earth-Simulator
2008,1.03E+15,Roadrunner
2016,9.30E+16,TaihuLight
2018,1.22E+17,Summit
9 changes: 9 additions & 0 deletions exercise5/data/Prozessoren.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Jahr,FLOPS,Rechner
1978,1.20E+04,8086/87
1985,1.70E+05,80386/87
1989,2.00E+06,80486
1996,6.20E+07,Pentium Pro
2007,6.54E+09,Pentium Woodcrest
2007,4.26E+10,Core 2 Q6600
2014,3.20E+10,i5-4300U
2016,9.60E+11,Xeon E7-8890
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
numpy>=1.21.2
numpy>=1.21.2
pandas>=1.3.5
scipy>=1.7.3