-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ajoute le code d'import des données partie ML
- Loading branch information
1 parent
7d12af8
commit 0bb0254
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
``` | ||
::: | ||
|