Skip to content

Commit 47a0770

Browse files
committed
fix API notebook
1 parent d242257 commit 47a0770

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

content/manipulation/04c_API_TP.qmd

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,9 @@ Assuming the sales DataFrame is called `ventes`, we first need to convert it int
538538
:::
539539

540540
```{python}
541-
#| eval: false
541+
542+
data_immo = requests.get("http://api.cquest.org/dvf?code_commune=29168").json()
543+
ventes = pd.json_normalize(data_immo["resultats"])
542544
543545
ventes = ventes.dropna(subset = ['lat','lon'])
544546
ventes = gpd.GeoDataFrame(ventes, geometry=gpd.points_from_xy(ventes.lon, ventes.lat))
@@ -550,21 +552,16 @@ ventes
550552
Avant de faire une carte, on va convertir
551553
les limites de la commune de Plogoff en geoJSON pour faciliter
552554
sa représentation avec `folium`
553-
([voir la doc `geopandas` à ce propos](https://geopandas.readthedocs.io/en/latest/gallery/polygon_plotting_with_folium.html#Add-polygons-to-map)):
555+
([voir la doc `Geopandas` à ce propos](https://geopandas.readthedocs.io/en/latest/gallery/polygon_plotting_with_folium.html#Add-polygons-to-map)):
554556

555557
:::
556558

557559
::: {.content-visible when-profile="en"}
558560

559-
Before making a map, we will convert the boundaries of the Plogoff municipality to GeoJSON for easier representation with `folium` ([see the `geopandas` documentation](https://geopandas.readthedocs.io/en/latest/gallery/polygon_plotting_with_folium.html#Add-polygons-to-map)):
561+
Before making a map, we will convert the boundaries of the Plogoff municipality to GeoJSON for easier representation with `folium` ([see the `Geopandas` documentation](https://geopandas.readthedocs.io/en/latest/gallery/polygon_plotting_with_folium.html#Add-polygons-to-map)):
560562

561563
:::
562564

563-
```{python}
564-
#| eval: false
565-
geo_j = plgf.to_json()
566-
```
567-
568565
::: {.content-visible when-profile="fr"}
569566

570567
Pour représenter graphiquement, on peut utiliser le code suivant (essayez de
@@ -579,8 +576,7 @@ To graphically represent this, you can use the following code (try to understand
579576
:::
580577

581578
```{python}
582-
#| output: hide
583-
#| eval: false
579+
#| output: false
584580
import folium
585581
import numpy as np
586582
@@ -611,8 +607,6 @@ m.fit_bounds([sw, ne])
611607

612608

613609
```{python}
614-
#| echo : true
615-
#| eval: false
616610
# Afficher la carte
617611
m
618612
```

0 commit comments

Comments
 (0)