You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/manipulation/04c_API_TP.qmd
+201-8Lines changed: 201 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -135,16 +135,21 @@ An API is intended to serve as an intermediary between a client and a server. Th
135
135
The first mode (access via a browser) is primarily used when a web interface allows a user to make choices in order to return results corresponding to those selections. Let’s revisit the example of the geolocation API that we will use in this chapter. Imagine a web interface that offers the user two choices: a postal code and an address. These inputs will be injected into the query, and the server will respond with the appropriate geolocation.
136
136
:::
137
137
138
-
::::: {.content-visible when-format="ipynb"}
139
138
140
-
:::: {.content-visible when-profile="fr"}
139
+
::::: {.content-visible when-profile="fr"}
140
+
141
+
:::: {.content-visible when-format="ipynb"}
141
142
142
143
::: {.important}
143
144
Une explication interactive est disponible sur [le site du cours](https://pythonds.linogaliana.fr/content/manipulation/04c_API_TP.html).
144
145
:::
145
146
146
147
::::
147
148
149
+
:::::
150
+
151
+
::::: {.content-visible when-format="ipynb"}
152
+
148
153
:::: {.content-visible when-profile="en"}
149
154
150
155
::: {.important}
@@ -153,7 +158,7 @@ An interactive explanation is available on [the course website](https://pythonds
153
158
154
159
::::
155
160
156
-
::::
161
+
:::::
157
162
158
163
:::: {.content-visible when-format="html"}
159
164
@@ -236,6 +241,7 @@ Si on veut un beau rendu, comme la carte ci-dessus, il faudra que le navigateur
236
241
If a beautiful display is desired, like the map above, the web browser will need to reprocess this output, which is typically done using `Javascript`, the programming language embedded in web browsers.
237
242
:::
238
243
244
+
::::
239
245
240
246
::: {.content-visible when-profile="fr"}
241
247
## Comment faire avec `Python` ?
@@ -1386,15 +1392,15 @@ One of the objectives of the [3rd-year production deployment course](https://ens
1386
1392
# Exercices supplémentaires
1387
1393
1388
1394
::: {.exercise}
1389
-
## Exercice bonus
1395
+
## Exercice bonus 1: et si on ajoutait des informations sur la valeur ajoutée des lycées ?
1390
1396
1391
1397
Dans notre exemple sur les écoles, se restreindre aux lycées et ajouter les informations sur la valeur ajoutée des lycées disponibles [ici](https://data.education.gouv.fr/explore/dataset/fr-en-indicateurs-de-resultat-des-lycees-denseignement-general-et-technologique/table/?sort=-annee).
1392
1398
:::
1393
1399
1394
1400
::::
1395
1401
1396
1402
:::: {.content-visible when-profile="en"}
1397
-
# Additional Exercises
1403
+
# Additional Exercises: et si on ajoutait des informations sur la valeur ajoutée des lycées ?
1398
1404
1399
1405
::: {.exercise}
1400
1406
## Bonus Exercise
@@ -1404,14 +1410,201 @@ In our example on schools, limit the scope to high schools and add information o
1404
1410
1405
1411
::::
1406
1412
1413
+
:::: {.content-visible when-profile="fr"}
1414
+
1415
+
::: {.exercise}
1416
+
## Exercice bonus 2: on sort où ce soir ?
1417
+
1418
+
Trouver un lieu commun où se retrouver entre amis est toujours l'objet d'âpres négociations: et si on laissait guider par la géographie ?
1419
+
1420
+
1. Créer un `DataFrame` enregistrant une série d'adresses et de codes postaux comme l'exemple ci-dessous
1421
+
2. Adapter le code de l'exercice sur l'API BAN, avec l'appui de la documentation, pour géolocaliser ces adresses
1422
+
3. En supposant que vos données géolocalisées se nomment `adresses_geocoded`, utiliser le code proposé pour transformer celles-ci en polygone
1423
+
4. Calculer le centroid et représenter sur une carte interactive `Folium` comme précédemment
1424
+
1425
+
Vous aviez oublié qu'il y avait un couple dans le groupe... Tenir compte de la variable `poids` pour calculer le barycentre et trouver où vous retrouver ce soir.
0 commit comments