Skip to content

Commit

Permalink
ajoute le code d'import des données partie ML
Browse files Browse the repository at this point in the history
  • Loading branch information
linogaliana committed Dec 10, 2023
1 parent 7d12af8 commit 0bb0254
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions content/modelisation/_import_data_ml.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Ce chapitre utilise toujours le même jeu de données, présenté dans l'[introduction
de cette partie](index.qmd) : les données de vote aux élections présidentielles américaines
croisées à des variables sociodémographiques.
Le code
est disponible [sur Github](https://github.com/linogaliana/python-datascientist/blob/master/content/modelisation/get_data.py).


```{python}
#| eval: false
#| echo: true
!pip install --upgrade xlrd #colab bug verson xlrd
!pip install geopandas
```

::: {.python}
```{python}
#| echo: true
#| output: false
import requests
url = 'https://raw.githubusercontent.com/linogaliana/python-datascientist/master/content/modelisation/get_data.py'
r = requests.get(url, allow_redirects=True)
open('getdata.py', 'wb').write(r.content)
import getdata
votes = getdata.create_votes_dataframes()
```
:::

0 comments on commit 0bb0254

Please sign in to comment.