Skip to content

Commit 3248633

Browse files
Shortcode rawhtml (#354)
* premier rawhtml * raw * rawhtml * topojson * update * Update index.qmd * Automated changes * Automated changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 7e15843 commit 3248633

File tree

4 files changed

+41
-33
lines changed

4 files changed

+41
-33
lines changed

content/course/manipulation/04a_webscraping_TP/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,13 +693,13 @@ m.fit_bounds([sw, ne])
693693

694694
La carte obtenue doit ressembler à la suivante:
695695

696-
{{< rawhtml >}}
696+
{{{< rawhtml >}}}
697697
```{python}
698698
#| echo : false
699699
# Afficher la carte
700700
m
701701
```
702-
{{< /rawhtml >}}
702+
{{{< /rawhtml >}}}
703703

704704

705705
# Récupérer des informations sur les pokemons

content/course/manipulation/04c_API_TP/index.qmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ def interactive_map_dpe(dpe):
278278
m = interactive_map_dpe(dpe)
279279
```
280280

281-
{{< rawhtml >}}
281+
{{{< rawhtml >}}}
282282
```{python}
283283
#| echo : false
284284
# Afficher la carte
285285
m
286286
```
287-
{{< /rawhtml >}}
287+
{{{< /rawhtml >}}}
288288

289289
On remarque un problème dans les données: un logement qui n'a
290290
rien à voir avec les autres. Il faudrait donc idéalement
@@ -328,13 +328,13 @@ dpe_geo_filter = get_dpe_from_url(url_api)
328328
m_geo_filter = interactive_map_dpe(dpe)
329329
```
330330

331-
{{< rawhtml >}}
331+
{{{< rawhtml >}}}
332332
```{python}
333333
#| echo : false
334334
# Afficher la carte
335335
m_geo_filter
336336
```
337-
{{< /rawhtml >}}
337+
{{{< /rawhtml >}}}
338338

339339
## Un catalogue incomplet d'API existantes
340340

@@ -520,13 +520,13 @@ m.fit_bounds([sw, ne])
520520
m
521521
```
522522

523-
{{< rawhtml >}}
523+
{{{< rawhtml >}}}
524524
```{python}
525525
#| echo : false
526526
# Afficher la carte
527527
m
528528
```
529-
{{< /rawhtml >}}
529+
{{{< /rawhtml >}}}
530530

531531

532532

@@ -748,13 +748,13 @@ m.fit_bounds([sw, ne])
748748

749749
Ce qui permet d'obtenir la carte:
750750

751-
{{< rawhtml >}}
751+
{{{< rawhtml >}}}
752752
```{python}
753753
#| echo : false
754754
# Afficher la carte
755755
m
756756
```
757-
{{< /rawhtml >}}
757+
{{{< /rawhtml >}}}
758758

759759
Vous pouvez aller plus loin avec l'exercice suivant.
760760
Celui-ci nécessite une fonction pour créer un cercle autour d'un point (source [ici](https://gis.stackexchange.com/questions/289044/creating-buffer-circle-x-kilometers-from-point-using-python/289923)),

content/course/modelisation/6_pipeline/index.qmd

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ set_config(display='diagram')
142142
pipe
143143
~~~
144144

145-
{{< rawhtml >}}
145+
{{{< rawhtml >}}}
146146

147147
```{python}
148148
#| output: asis
149149
#| echo: false
150150
print(estimator_html_repr(pipe))
151151
```
152152

153-
{{< /rawhtml >}}
153+
{{{< /rawhtml >}}}
154154

155155
Au sein d'une étape de *pipeline*, les paramètres d'un estimateur
156156
sont accessibles avec la notation `<estimator>__<parameter>`.
@@ -165,15 +165,15 @@ param_grid = {"reduce_dim__n_components":[2, 5, 10], "clf__C":[0.1, 10, 100]}
165165
grid_search = GridSearchCV(pipe, param_grid=param_grid)
166166
```
167167

168-
{{< rawhtml >}}
168+
{{{< rawhtml >}}}
169169

170170
```{python}
171171
#| output: asis
172172
#| echo: false
173173
print(estimator_html_repr(grid_search))
174174
```
175175

176-
{{< /rawhtml >}}
176+
{{{< /rawhtml >}}}
177177

178178

179179
## Données utilisées
@@ -396,15 +396,15 @@ ce _pipeline_ opère:
396396
pipe
397397
~~~
398398

399-
{{< rawhtml >}}
399+
{{{< rawhtml >}}}
400400

401401
```{python}
402402
#| output: asis
403403
#| echo: false
404404
print(estimator_html_repr(pipe))
405405
```
406406

407-
{{< /rawhtml >}}
407+
{{{< /rawhtml >}}}
408408

409409

410410
Maintenant, il ne reste plus qu'à estimer notre modèle sur l'ensemble
@@ -615,16 +615,15 @@ end_time = time.time()
615615
print("Elapsed time : {} seconds", int(end_time - start_time))
616616
```
617617

618-
{{< rawhtml >}}
618+
{{{< rawhtml >}}}
619619

620620
```{python}
621621
#| output: asis
622622
#| echo: false
623623
print(estimator_html_repr(grid_search))
624624
```
625625

626-
{{< /rawhtml >}}
627-
626+
{{{< /rawhtml >}}}
628627

629628
```{python}
630629
#| echo: false
@@ -645,15 +644,15 @@ grid_search.best_estimator_
645644
~~~
646645

647646

648-
{{< rawhtml >}}
647+
{{{< rawhtml >}}}
649648

650649
```{python}
651650
#| output: asis
652651
#| echo: false
653652
print(estimator_html_repr(grid_search.best_estimator_))
654653
```
655654

656-
{{< /rawhtml >}}
655+
{{{< /rawhtml >}}}
657656

658657
Toutes les performances sur les ensembles d'échantillons et de test sur la grille
659658
d'hyperparamètres sont disponibles dans l'attribut:
@@ -971,15 +970,15 @@ pipe2 = Pipeline([
971970
])
972971
```
973972

974-
{{< rawhtml >}}
973+
{{{< rawhtml >}}}
975974

976975
```{python}
977976
#| output: asis
978977
#| echo: false
979978
print(estimator_html_repr(pipe2))
980979
```
981980

982-
{{< /rawhtml >}}
981+
{{{< /rawhtml >}}}
983982

984983
```{python}
985984
preprocessor = ColumnTransformer(
@@ -991,15 +990,15 @@ pipe3 = Pipeline(steps=[('preprocessor', preprocessor),
991990
('randomforest', regr)])
992991
```
993992

994-
{{< rawhtml >}}
993+
{{{< rawhtml >}}}
995994

996995
```{python}
997996
#| output: asis
998997
#| echo: false
999998
print(estimator_html_repr(pipe3))
1000999
```
10011000

1002-
{{< /rawhtml >}}
1001+
{{{< /rawhtml >}}}
10031002

10041003
# Références
10051004

content/course/visualisation/maps/index.qmd

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -590,14 +590,13 @@ m.fit_bounds([sw, ne])
590590

591591

592592

593-
{{< rawhtml >}}
593+
{{{< rawhtml >}}}
594594
```{python}
595595
#| echo : false
596596
# Afficher la carte
597597
m
598598
```
599-
{{< /rawhtml >}}
600-
599+
{{{< /rawhtml >}}}
601600

602601
::: {.cell .markdown}
603602
```{=html}
@@ -654,13 +653,13 @@ m.fit_bounds([sw, ne])
654653

655654
La carte obtenue doit ressembler à la suivante:
656655

657-
{{< rawhtml >}}
656+
{{{< rawhtml >}}}
658657
```{python}
659658
#| echo : false
660659
# Afficher la carte
661660
m
662661
```
663-
{{< /rawhtml >}}
662+
{{{< /rawhtml >}}}
664663

665664
# Exercices supplémentaires
666665

@@ -672,7 +671,14 @@ parisiens et communes dans les autres villes.
672671

673672
Nous allons privilégier une carte à ronds proportionnels (_bubble map_)
674673
aux cartes chorolèpthes qui trompent
675-
l'oeil.
674+
l'oeil. Les instructions d'installation du package `topojson`
675+
sont disponibles dans la partie manipulation
676+
677+
```{python}
678+
#| echo: false
679+
#| output: false
680+
!pip install topojson
681+
```
676682

677683
::: {.cell .markdown}
678684
```{=html}
@@ -713,8 +719,11 @@ from cartiflette.s3 import download_vectorfile_url_all
713719
# 1/ Fonds communaux
714720
df = download_vectorfile_url_all(
715721
values = ["75", "92", "93", "94"],
716-
level="COMMUNE_ARRONDISSEMENT",
717-
decoupage="departement")
722+
crs=4326,
723+
borders="COMMUNE_ARRONDISSEMENT",
724+
filter_by="DEPARTEMENT",
725+
source="EXPRESS-COG-CARTO-TERRITOIRE",
726+
year=2022)
718727
# 2/ Lambert 93
719728
df = df.to_crs(2154)
720729
# 3/ Départements

0 commit comments

Comments
 (0)