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

Finalize assignment - Seminar 23-09 #40

Open
wants to merge 2 commits into
base: master
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
168 changes: 168 additions & 0 deletions Solution_SenneBakker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>Solution_SenneBakker</title>
<style>
html {
line-height: 1.5;
font-family: Georgia, serif;
font-size: 20px;
color: #1a1a1a;
background-color: #fdfdfd;
}
body {
margin: 0 auto;
max-width: 36em;
padding-left: 50px;
padding-right: 50px;
padding-top: 50px;
padding-bottom: 50px;
hyphens: auto;
overflow-wrap: break-word;
text-rendering: optimizeLegibility;
font-kerning: normal;
}
@media (max-width: 600px) {
body {
font-size: 0.9em;
padding: 1em;
}
}
@media print {
body {
background-color: transparent;
color: black;
font-size: 12pt;
}
p, h2, h3 {
orphans: 3;
widows: 3;
}
h2, h3, h4 {
page-break-after: avoid;
}
}
p {
margin: 1em 0;
}
a {
color: #1a1a1a;
}
a:visited {
color: #1a1a1a;
}
img {
max-width: 100%;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 1.4em;
}
h5, h6 {
font-size: 1em;
font-style: italic;
}
h6 {
font-weight: normal;
}
ol, ul {
padding-left: 1.7em;
margin-top: 1em;
}
li > ol, li > ul {
margin-top: 0;
}
blockquote {
margin: 1em 0 1em 1.7em;
padding-left: 1em;
border-left: 2px solid #e6e6e6;
color: #606060;
}
code {
font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
font-size: 85%;
margin: 0;
}
pre {
margin: 1em 0;
overflow: auto;
}
pre code {
padding: 0;
overflow: visible;
overflow-wrap: normal;
}
.sourceCode {
background-color: transparent;
overflow: visible;
}
hr {
background-color: #1a1a1a;
border: none;
height: 1px;
margin: 1em 0;
}
table {
margin: 1em 0;
border-collapse: collapse;
width: 100%;
overflow-x: auto;
display: block;
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
margin-bottom: 0.75em;
}
tbody {
margin-top: 0.5em;
border-top: 1px solid #1a1a1a;
border-bottom: 1px solid #1a1a1a;
}
th {
border-top: 1px solid #1a1a1a;
padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
margin-bottom: 4em;
text-align: center;
}
#TOC li {
list-style: none;
}
#TOC a:not(:hover) {
text-decoration: none;
}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<h1 id="articles">Articles</h1>
<p>The titles of the articles are:</p>
<ul>
<li>An analysis of the forces required to drag sheep over various surfaces.</li>
<li>Fantastic yeasts and where to find them: the hidden diversity of dimorphic fungal pathogens.</li>
<li>The neurocognitive effects of alcohol on adolescents and college students.</li>
</ul>
<h1 id="beer-consumption">Beer consumption</h1>
<p>Looking at the plots shown below, it can be seen that the absolute beer consumption rises significantly, from 2013 to 2018. The increase in beer consumption over that same period is approximately 5%. Before 2014, from 2006 until 2014, beer consumption was approximately constant, with little fluctuations.</p>
<p><img src="/Users/Senne/Documents/Senne%20Bakker/UVA:VU/Seminar/Assignment%20lec%203/CS_Assignment/Absolute.png" title="absolute" /></p>
<p>However, when looking at the relative beer consumption in that period, we see that university students are drinking less beer. The increase in absolute beer consumption seems to be connected to the increase of number of students. The number of students rose with approximately 36%. This can also be seen in the relative beer consumption shown below.</p>
<p><img src="/Users/Senne/Documents/Senne%20Bakker/UVA:VU/Seminar/Assignment%20lec%203/CS_Assignment/Ratio.png" title="relative" /></p>
<p>The beer consumption per capita decreases quite steadily over the period from 2006 to 2018. It decreases with approximately 20%.</p>
<p>However, the numbers in the data seem to be a bit off. In the sense that it shows that every university student drinks about 4400 liters beer in a year. This corresponds to an average of almost 85 liters of beer every week, which is a ridiculous amount.</p>
</body>
</html>
20 changes: 20 additions & 0 deletions Solution_SenneBakker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Articles
The titles of the articles are:

- An analysis of the forces required to drag sheep over various surfaces.
- Fantastic yeasts and where to find them: the hidden diversity of dimorphic fungal pathogens.
- The neurocognitive effects of alcohol on adolescents and college students.

# Beer consumption
Looking at the plots shown below, it can be seen that the absolute beer consumption rises significantly, from 2013 to 2018. The increase in beer consumption over that same period is approximately 5%. Before 2014, from 2006 until 2014, beer consumption was approximately constant, with little fluctuations.


![](/Users/Senne/Documents/Senne Bakker/UVA:VU/Seminar/Assignment lec 3/CS_Assignment/Absolute.png "absolute")

However, when looking at the relative beer consumption in that period, we see that university students are drinking less beer. The increase in absolute beer consumption seems to be connected to the increase of number of students. The number of students rose with approximately 36%. This can also be seen in the relative beer consumption shown below.

![](/Users/Senne/Documents/Senne Bakker/UVA:VU/Seminar/Assignment lec 3/CS_Assignment/Ratio.png "relative")

The beer consumption per capita decreases quite steadily over the period from 2006 to 2018. It decreases with approximately 20%.

However, the numbers in the data seem to be a bit off. In the sense that it shows that every university student drinks about 4400 liters beer in a year. This corresponds to an average of almost 85 liters of beer every week, which is a ridiculous amount.
30 changes: 30 additions & 0 deletions plot_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pandas as pd
import matplotlib.pyplot as plt
pd.options.mode.chained_assignment = None


data1 = pd.read_csv("/Users/Senne/Documents/Senne Bakker/UVA:VU/Seminar/Assignment lec 3/CS_Assignment/istherecorrelation.csv",delimiter=";")

years = data1.iloc[:,0]
# Number of students in terms of thousands
wo = data1.iloc[:,1]
print(wo)
# Beer consumptions in terms of thousands of hectoliters
beer_cons = data1.iloc[:,2]
ratio = []

# convert data
for i in range(len(beer_cons)):
wo[i] = wo[i].replace(',', '.', 1)
wo[i] = float(wo[i])

ratio.append(beer_cons[i]/wo[i])


# plot data
# plt.scatter(years, ratio)
plt.scatter(years, beer_cons)
plt.title("Total beer consumption over the years")
plt.xlabel("Years")
plt.ylabel("Consumption (10^3 hl)")
plt.show()