diff --git a/Figure1.png b/Figure1.png new file mode 100644 index 0000000..dc66e67 Binary files /dev/null and b/Figure1.png differ diff --git a/plotting.py b/plotting.py new file mode 100644 index 0000000..8bd98e3 --- /dev/null +++ b/plotting.py @@ -0,0 +1,34 @@ +import pandas as pd +import matplotlib.pyplot as plt +import numpy as np + +# read data +df = pd.read_csv('istherecorrelation.csv', sep = ';') + +x = df['WO [x1000]'] +y = df['NL Beer consumption [x1000 hectoliter]'] + +x = list(map(lambda x:x.replace(',', '.'), x)) +x = list(map(lambda x:float(x), x)) +y = list(map(lambda x:float(x), y)) + +# fit trendline +a, b = np.polyfit(x, y, 1) +print(a) +print(b) + +# scatterplot +plt.plot(x, y, 'bo', label = 'Data') + +# plot trendline +xvals = [205, 280] +yvals = list(map(lambda x:a*x + b, xvals)) +plt.plot(xvals, yvals, 'r-', label = 'Linear fit' ) + + +plt.xlabel('WO [x1000]') +plt.ylabel('NL Beer consumption [x1000 hectoliter]') + +plt.legend() +plt.title('WO students vs. Beer consumption in the Netherlands') +plt.show() diff --git a/solution_.md b/solution_.md new file mode 100644 index 0000000..03207ea --- /dev/null +++ b/solution_.md @@ -0,0 +1,8 @@ +## Papers everyone should read: +- The Rise of Coccidioides: Forces Against the Dust Devil Unleashed +- An analysis of the forces required to drag sheep over various surfaces. +- Forebrain Origins of Glutamatergic Innervation to the Rat Paraventricular Nucleus of the Hypothalamus: Differential Inputs to the Anterior Versus Posterior Subregions + +![Plot](Figure1.png) + +Plotting the number of WO students against the beer consumption in the Netherlands suggests there is a positive correlation between these two variables. Further regression analysis could help to confirm this hypothesis. \ No newline at end of file