# Mini-Project B3:
## On methodology
<!-- Put the link to this slide here so people can follow -->
- Sally, Magnus, Emilio and Jonathan
---
# Why the how?
*Very good question*
---
## Step 1
- The dataset
 20.814 rows later 
---
## Step 2
- Moving to pandas
``` python=
import pandas as pd
co2_df = pd.read_csv("./co2_emission.csv")
print(co2_df)
```

---
## Step 3
- Dirty data?
```python=
print(co2_df.isnull().sum())
```

----
#### Step 3.5
:bath:
- Cleaning data
```python=
co2_df_noCode = co2_df.drop(labels="Code", axis=1)
print(co2_df_noCode)
```

---
## Step 4
- Visualizing the data
```python=
def make_graph(country):
title = country + " Co2 Emissions"
co2_df_country = co2_df[co2_df["Entity"] == country]
co2_df_country.plot(
x="Year",
y="Annual CO₂ emissions (tonnes )",
title=title
)
make_graph("Denmark")
```
----
## Step 4.5
- The graph for Denmark

---
## Step 5
- Going worldwide
```python=
def graph_world():
hasOccured = [];
for country in co2_df["Entity"]:
if(country in hasOccured):
continue
else:
hasOccured.append(country)
for country in hasOccured:
make_graph(country)
graph_world()
```
----

#### Now what?
---
## Step 6
- Understanding the visualization
```python=
make_graph("World")
```

le10?
----
- The data
```python=
co2_df_world = co2_df[co2_df["Entity"] == "World"]
print(co2_df_world)
```

3.615326e+10?
----

##### The highest annual worldwide emission of CO~2~ > People alive today
:shocked_face_with_exploding_head:
---
## Step 6.5
- What about Denmark?

----
```python=
co2_df_dk = co2_df[co2_df["Entity"] == "Denmark"]
co2_df_dk_highest = co2_df_dk.sort_values(
by=['Annual CO₂ emissions (tonnes )'],
ascending=False
)
print(co2_df_dk_highest)
```


##### How many cars would it take to produce that much CO~2~?
----
> "A typical passenger vehicle emits about ==4.6 metric tons== of carbon dioxide per year"
([epa.gov](https://https://www.epa.gov/greenvehicles/greenhouse-gas-emissions-typical-passenger-vehicle), 2018)
----
$\frac{74877499.12}{4.6} = 16.277.717,2$

##### It would take ==16 million cars== to produce the amount of CO~2~ emitted in Denmark in 1996
----
#### Which correlates to about 3 times the amount of people in Denmark in 1996

:thinking_face:
{"metaMigratedAt":"2023-06-15T14:53:59.606Z","metaMigratedFrom":"YAML","title":"Mini-Project B3","breaks":true,"description":"View the slide with \"Slide Mode\".","contributors":"[{\"id\":\"57d772a1-6bfb-4356-8ecc-f56249314ac6\",\"add\":8553,\"del\":5530},{\"id\":\"dd497130-207f-4e30-987c-a4371c29f4c6\",\"add\":13,\"del\":11},{\"id\":\"8e2a5197-b067-486a-b336-67a1bcf30dae\",\"add\":18,\"del\":0}]"}