Skip to content
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
Binary file added Figure1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions plotting.py
Original file line number Diff line number Diff line change
@@ -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()
8 changes: 8 additions & 0 deletions solution_.md
Original file line number Diff line number Diff line change
@@ -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.