-
Introduction 1
-
Lecture1.1
-
-
Getting the Data 4
-
Lecture2.1
-
Lecture2.2
-
Lecture2.3
-
Lecture2.4
-
-
Location Groups 3
-
Lecture3.1
-
Lecture3.2
-
Lecture3.3
-
-
Creating the New Data 3
-
Lecture4.1
-
Lecture4.2
-
Lecture4.3
-
-
Mapping the Data 3
-
Lecture5.1
-
Lecture5.2
-
Lecture5.3
-
Location Codes
Let’s import libraries, and open our data up.
import pandas as pd
import numpy as np
import gmplot
Assess_Combined = pd.DataFrame.from_csv("Assess_Combined.csv",encoding="UTF-8")
Now, we want a way to represent both the latitude and longitude together. Here is how we will do it.
print(Assess_Combined["Lat Group"].astype(str)+"-"+Assess_Combined["Lon Group"].astype(str))
First off, we have to use .astype(str) to convert our integer groups to strings. We are then putting the two together with a dash to seperate them. Let’s assign this to a new column which we will call loc code.
Assess_Combined["LocCode"] = Assess_Combined["Lat Group"].astype(str)+"-"+Assess_Combined["Lon Group"].astype(str)
Challenge
Turn our data into a dataset of each location code, and their average values for each variable.
Prev
Introduction
Next
Boundary Lines