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 Beer consumption and WO.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

df = pd.read_csv('istherecorrelation.csv', sep = ';')
df["WO [x1000]"]=df["WO [x1000]"].str.replace(',','.')
df["WO [x1000]"]=pd.to_numeric(df["WO [x1000]"],errors = 'coerce')

fig, ax1 = plt.subplots()

x = df['Year']
y1 = df['WO [x1000]']
y2 = df['NL Beer consumption [x1000 hectoliter]']

color = 'tab:red'
ax1.set_xlabel('Year')
ax1.set_ylabel('WO [x1000]', color=color)
ax1.plot(x, y1, color=color)

ax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis

color = 'tab:blue'
ax2.set_ylabel('Beer consumption [x1000 hectoliter]', color=color) # we already handled the x-label with ax1
ax2.plot(x, y2, color=color)

fig.tight_layout() # otherwise the right y-label is slightly clipped

plt.show()

fig.savefig('Beer consumption and WO.jpg',
format='jpeg',
dpi=300,
bbox_inches='tight')
9 changes: 9 additions & 0 deletions solution_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Papers
1. MCC Van Dyke et al., 2019. The Rise of Coccidioides: Forces Against the Dust Devil Unleashed
2. JT Harvey, Applied Ergonomics, 2002. An analysis of the forces required to drag sheep over various surfaces
3. DW Ziegler et al., 2005. Correlation of continuous cardiac output measured by a pulmonary artery catheter versus impedance cardiography in ventilated patients

Beer consumption and WO over time
![alt text](https://github.com/mercylyn/CS_Assignment/blob/master/Beer%20consumption%20and%20WO.jpg)

The graph above shows the number of students in WO (higher education) and beer consumption between the years 2006 and 2018. There is a clear upward trend from 2013 until 2018 in both students in WO and beer consumption.