Skip to content

Commit

Permalink
fix notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaupetit committed Sep 13, 2024
1 parent 6a4a111 commit 0cead0d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/notebook/misc/import-geo-population-area.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ engine = create_engine(database_url)
```

```python
import geopandas as gp
import geopandas as gp

with engine.connect() as conn:
cities = gp.read_postgis("city", conn, geom_col='geometry', crs=4326)
Expand Down Expand Up @@ -81,9 +81,9 @@ population[population["code"] == "85165"]
```python
import numpy as np

crs = pd.DataFrame.from_records(
crs = pd.DataFrame.from_records(
[(f"{d:02d}", 9794) for d in range(1, 96) if d != 20] + [
("2A", 9794),
("2A", 9794),
("2B", 9794)] + [
("971", 5490),
("972", 5490),
Expand Down Expand Up @@ -209,9 +209,13 @@ population
```

```python
epcis = epcis.merge(population[["code", "populationTotale"]], how="left", on="code")
population["membres"].apply(lambda x: x[0]["code"])
```

```python
epcis = epcis.merge(population[["code", "populationMunicipale"]], how="left", on="code")
epcis.drop(["population"], axis=1, inplace=True)
epcis.rename(columns={"populationTotale": "population"}, inplace=True)
epcis.rename(columns={"populationMunicipale": "population"}, inplace=True)
epcis
```

Expand Down

0 comments on commit 0cead0d

Please sign in to comment.