Want to learn more? Take the full course at [ Ссылка ] at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.
---
Hello. My name is Mary van Valkenburg. I’m the Data Science Program Manager at Nashville Software School. Welcome to this course on Visualizing Geospatial Data in Python.
Location is an important element in understanding how things are related.To illustrate this point, let's go back in time to 1854
when more than 600 people in London died of cholera.
At the time, it was thought that miasma (or bad air) caused the illness.
A local physician named John Snow was skeptical of the prevailing theory and began collecting data about the people who had perished.
Snow drew dots on a map to show where deaths had occurred, and soon realized that they were clustered around the Broad Street Water Pump. The pump was shut down as a result, bringing the epidemic to an end.
You will learn how to use location to discover meaning in data, including
how to plot location points on a map as a scatterplot,
how to plot geometries using geopandas
You’ll learn to construct a geopandas GeoDataFrame from a pandas DataFrame
and you’ll learn to join two GeoDataFrames so that they are spatially related.
You’ll get practice adding a street map to give even more context to your visualizations.
And you will learn when and how to create a choropleth in order to compare different regions to one another.
Traditionally, scatterplots are used to show how two variables are related to each other. Here we have a scatterplot of the father and son heights used by Karl Pearson to explore regression in the early 1900s.
We can borrow the plotting mechanism of a scatterplot to show location because latitude and longitude lines draw a grid. Longitude are the lines that run north to south, and latitude are the lines that run east to west. We use negative values for latitude south of the Equator and for longitude west of the Greenwich Meridian.
Style elements like color and marker type help make your plot visually appealing,
Axis labels and titles add information, while gridlines give a more precise idea of where things are.
Longitude is always plotted along the horizontal axis, while latitude is plotted along the vertical axis.
Datasets won't always have latitude and longitude neatly separated. Sometimes they are embedded like in the location column of this bus stop data.
In this case you can just pull each value from the location tuple and store it in a new column like we have done here using two list comprehensions.
Other times, the steps to separate longitude and latitude are not that simple. This Location column has additional information stored in it.
Here we use a regular expression to parse longitude and latitude. The regular expression captures the value between the opening parenthesis and the comma as latitude and the value after the comma and before the closing parenthesis as longitude.
Now it's just a matter of pulling latitude and longitude from each tuple like before.
In your first exercise, you’ll be looking at where the chickens are in the city of Nashville, Tennessee in the United States.
The data you will use comes from Nashville’s Open Data site. Your city, state or country is likely to have open data too. It's becoming more prevalent. Open data is a great way to explore the places where you live and work while practicing your skills.
Let’s get our chicken data and plot the locations where domesticated hen permits have been issued, using longitude values for our x-axis and latitude values for our y-axis.
#PythonTutorial #DataCamp #Visualizing #Geospatial #Data #Python
Ещё видео!