Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
23db65e7e2b5fb82db5e83fb70a96150
mooc-rr
Commits
44346598
Commit
44346598
authored
Apr 27, 2020
by
escuiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extraction des colonnes utilisées
parent
96a3f991
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
2 deletions
+35
-2
exercice_python_fr.org
module3/exo2/exercice_python_fr.org
+35
-2
No files found.
module3/exo2/exercice_python_fr.org
View file @
44346598
...
@@ -46,6 +46,39 @@ table[:5]
...
@@ -46,6 +46,39 @@ table[:5]
| 202014 | 7 | 3879 | 2227 | 5531 | 6 | 3 | 9 | FR | France |
| 202014 | 7 | 3879 | 2227 | 5531 | 6 | 3 | 9 | FR | France |
| 202013 | 7 | 7326 | 5236 | 9416 | 11 | 8 | 14 | FR | France |
| 202013 | 7 | 7326 | 5236 | 9416 | 11 | 8 | 14 | FR | France |
Ok à première vue. Vérifions l'intégrité du jeu de données (lignes
** Extraction des colonnes utilisées
manquantes ou entrées erronnées).
#+begin_src python :results output :session :exports both
week = [row[0] for row in table]
assert week[0] == 'week'
del week[0]
inc = [row[2] for row in table]
assert inc[0] == 'inc'
del inc[0]
data = list(zip(week, inc))
#+end_src
#+RESULTS:
Vérification visuelle des premières et dernières lignes.
#+begin_src python :results value :session :exports both
[('week', 'inc'), None] + data[:5] + [None] + data[-5:]
#+end_src
#+RESULTS:
| week | inc |
|--------+-------|
| 202016 | 803 |
| 202015 | 1918 |
| 202014 | 3879 |
| 202013 | 7326 |
| 202012 | 8123 |
|--------+-------|
| 199101 | 15565 |
| 199052 | 19375 |
| 199051 | 19080 |
| 199050 | 11079 |
| 199049 | 1143 |
** Conversion des dates
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment