forked from linogaliana/python-datascientist
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.qmd
More file actions
102 lines (68 loc) · 2.51 KB
/
index.qmd
File metadata and controls
102 lines (68 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
toc: false
sidebar: false
title-block-style: none
css: homepage.css
listing:
id: sample-listings
contents: content/**/*.qmd
type: grid
sort: "number"
categories: true
#fields: [image, title, github, gitlab]
#template: cards.ejs
---
::: {#hero-banner .column-screen}
:::: {.grid .column-page}
::::: {.headline .g-col-lg-6 .g-col-12 .g-col-md-12}
:::::: h1
Python pour la _data science_ {{< fa brands python >}}
::::::
:::::: h2
Lino Galiana
::::::
```{=html}
<a class="github-button" href="https://github.com/linogaliana/python-datascientist" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star this website on Github">Star this website on Github</a><script async defer src="https://buttons.github.io/buttons.js"></script>
```
<br>
Ce site web rend public le contenu du cours de deuxième année (Master 1) de l'ENSAE:
[*Python pour la data-science*](https://www.ensae.fr/courses/1425-python-pour-le-data-scientist)
<a href="https://github.com/linogaliana/python-datascientist" class="github"><i class="fab fa-python"></i></a>
Tout est présent sur ce site _web_ ! Des `Notebooks Jupyter` peuvent être récupérés pour s'exercer. L'ensemble des codes sources est stocké sur [Github](https://github.com/linogaliana/python-datascientist)
<a href="https://github.com/linogaliana/python-datascientist" class="github"><i class="fab fa-github"></i></a>
<br>
:::::
::::: {.g-col-lg-6 .g-col-12 .g-col-md-12}

:::::
::::
:::
<br>
## Thèmes en vrac {.unnumbered}
Pour découvrir `Python` {{< fa brands python >}} de manière thématique
::: {#sample-listings}
:::
```{python}
#| include: false
#| eval: false
import os
import glob
import yaml
list_files = glob.glob("./content/**/*.qmd", recursive=True)
posts = [l for l in list_files if l.endswith('.qmd') ]
def extract_slug_from_markdown(file_path):
with open(file_path, 'r') as file:
content = file.read()
front_matter = yaml.safe_load(content.split('---', 2)[1])
if isinstance(front_matter, dict) and 'slug' in front_matter:
slug = front_matter['slug']
return slug
return None
# Extract the slugs
slugs = {post: extract_slug_from_markdown(post) for post in posts if extract_slug_from_markdown(post) is not None}
# Lines to insert in a Netlify _redirect file
redirects = [f"/{slug} /posts/{post}" for slug, post in zip(slugs, posts)]
# Write the _redirect file
with open("_site/_redirects", "w") as f:
f.write("\n".join(redirects))
```