Skip to content

GeoffroyGit/abeona

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this all about?

From a table containing location names (countries, cities, addresses, etc) and an indicator (a numerical value) for each location, this code creates a world map with each country colored according to the indicator.

Special thanks to GeoPandas

This code uses GeoPandas 🤩

Run my code yourself

Install

Clone the project:

git clone [email protected]:GeoffroyGit/abeona.git

I recommend you to create a fresh virtual environment

Create a python3 virtualenv and activate it:

cd abeona
pyenv virtualenv abeona
pyenv local abeona

Upgrade pip if needed:

pip install --upgrade pip

Install the dependancies:

pip install -r requirements.txt

Run in a notebook

Create a Jupyter notebook

jupyter notebook

Inside your notebook, run the following python code

Import GeoLoc

from geoloc import GeoLoc

Open your pandas dataframe

df = pd.read_csv("/path/to/your/file.csv")

or create a dummy dataframe

df = pd.DataFrame({
        "location" : ["Nantes", "Singapore", "Santiago", "New York", "Tokyo", "London", "Barcelona", "Nantes"],
        "indicator" : [7.0, 6.5, 5.5, 5.0, 4.7, 2.3, 1.0, 8.0]
    })

Create an instance of the class GeoLoc

geo_locator = GeoLoc(df)

Finally, plot the world map

geo_locator.plot();

About

Exploratory work on geoloc and maps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published