Skip to content

Commit 64dd4d7

Browse files
Compilation de la révision 77dcf20
1 parent 77dcf20 commit 64dd4d7

4 files changed

Lines changed: 36 additions & 32 deletions

File tree

en/04-mark_line.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
"source": [
9595
"alt.Chart(surveys_complete).mark_line().encode(\n",
9696
" x=alt.X('month').type('ordinal'),\n",
97-
" y=alt.Y('weight').aggregate('median'),\n",
97+
" y=alt.Y('weight').aggregate('median').scale(type='log', base=2),\n",
9898
" color=alt.Color('species_id'),\n",
99-
" tooltip=['species_id'],\n",
99+
" tooltip=['species_id', 'median(weight)'],\n",
100100
")"
101101
]
102102
},
@@ -160,7 +160,7 @@
160160
" x=alt.X(###),\n",
161161
" y=alt.Y('weight').###('median'),\n",
162162
" color=alt.Color('species_id'),\n",
163-
" tooltip=['species_id', 'date'],\n",
163+
" tooltip=['species_id', 'date', 'median(###)'],\n",
164164
")"
165165
]
166166
},
@@ -177,11 +177,12 @@
177177
"* **Choosing a type of chart**\n",
178178
" * `chart.mark_line()`\n",
179179
"* **Assigning data fields to encoding channels**:\n",
180-
" * `chart.encode(...)`\n",
181-
" * Encoding channels:\n",
182-
" * `y=alt.Y('count()')`\n",
183-
" * `y=alt.Y('field_for_Y').aggregate(...)`,\n",
184-
" with either `'mean'`, `'median'`, etc."
180+
" * `y=alt.Y('field_for_Y').aggregate('agg_func')`, with one of the\n",
181+
" [aggregation functions](https://altair-viz.github.io/user_guide/transform/aggregate.html#aggregation-functions):\n",
182+
" * `'count'`, `'sum'`\n",
183+
" * `'mean'`, `'stdev'`, `'variance'`\n",
184+
" * `'min'`, `'q1'`, `'median'`, `'q3'`, `'max'`\n",
185+
" * Short syntax: `y=alt.Y('agg_func(field_for_Y)')`"
185186
]
186187
},
187188
{

fr/04-mark_line.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
"source": [
9595
"alt.Chart(surveys_complet).mark_line().encode(\n",
9696
" x=alt.X('month').type('ordinal'),\n",
97-
" y=alt.Y('weight').aggregate('median'),\n",
97+
" y=alt.Y('weight').aggregate('median').scale(type='log', base=2),\n",
9898
" color=alt.Color('species_id'),\n",
99-
" tooltip=['species_id'],\n",
99+
" tooltip=['species_id', 'median(weight)'],\n",
100100
")"
101101
]
102102
},
@@ -161,7 +161,7 @@
161161
" x=alt.X(###),\n",
162162
" y=alt.Y('weight').###('median'),\n",
163163
" color=alt.Color('species_id'),\n",
164-
" tooltip=['species_id', 'date'],\n",
164+
" tooltip=['species_id', 'date', 'median(###)'],\n",
165165
")"
166166
]
167167
},
@@ -178,11 +178,12 @@
178178
"* **Choix du type de marqueurs** à afficher\n",
179179
" * `graphique.mark_line()`\n",
180180
"* **Assigner des variables** à des canaux du graphique\n",
181-
" * `graphique.encode(...)`\n",
182-
" * Différents canaux :\n",
183-
" * `y=alt.Y('count()')`\n",
184-
" * `y=alt.Y('varY').aggregate('stat')`,\n",
185-
" avec les statistiques `'mean'`, `'median'`, etc."
181+
" * `y=alt.Y('varY').aggregate('fonc_agg')`, avec une des [fonctions\n",
182+
" d'agrégation](https://altair-viz.github.io/user_guide/transform/aggregate.html#aggregation-functions) :\n",
183+
" * `'count'`, `'sum'`\n",
184+
" * `'mean'`, `'stdev'`, `'variance'`\n",
185+
" * `'min'`, `'q1'`, `'median'`, `'q3'`, `'max'`\n",
186+
" * Syntaxe courte : `y=alt.Y('fonc_agg(varY)')`"
186187
]
187188
},
188189
{

solution-en/04-mark_line.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
"source": [
9595
"alt.Chart(surveys_complete).mark_line().encode(\n",
9696
" x=alt.X('month').type('ordinal'),\n",
97-
" y=alt.Y('weight').aggregate('median'),\n",
97+
" y=alt.Y('weight').aggregate('median').scale(type='log', base=2),\n",
9898
" color=alt.Color('species_id'),\n",
99-
" tooltip=['species_id'],\n",
99+
" tooltip=['species_id', 'median(weight)'],\n",
100100
")"
101101
]
102102
},
@@ -160,7 +160,7 @@
160160
" x=alt.X('date'),\n",
161161
" y=alt.Y('weight').aggregate('median'),\n",
162162
" color=alt.Color('species_id'),\n",
163-
" tooltip=['species_id', 'date'],\n",
163+
" tooltip=['species_id', 'date', 'median(weight)'],\n",
164164
")"
165165
]
166166
},
@@ -177,11 +177,12 @@
177177
"* **Choosing a type of chart**\n",
178178
" * `chart.mark_line()`\n",
179179
"* **Assigning data fields to encoding channels**:\n",
180-
" * `chart.encode(...)`\n",
181-
" * Encoding channels:\n",
182-
" * `y=alt.Y('count()')`\n",
183-
" * `y=alt.Y('field_for_Y').aggregate(...)`,\n",
184-
" with either `'mean'`, `'median'`, etc."
180+
" * `y=alt.Y('field_for_Y').aggregate('agg_func')`, with one of the\n",
181+
" [aggregation functions](https://altair-viz.github.io/user_guide/transform/aggregate.html#aggregation-functions):\n",
182+
" * `'count'`, `'sum'`\n",
183+
" * `'mean'`, `'stdev'`, `'variance'`\n",
184+
" * `'min'`, `'q1'`, `'median'`, `'q3'`, `'max'`\n",
185+
" * Short syntax: `y=alt.Y('agg_func(field_for_Y)')`"
185186
]
186187
},
187188
{

solution-fr/04-mark_line.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
"source": [
9595
"alt.Chart(surveys_complet).mark_line().encode(\n",
9696
" x=alt.X('month').type('ordinal'),\n",
97-
" y=alt.Y('weight').aggregate('median'),\n",
97+
" y=alt.Y('weight').aggregate('median').scale(type='log', base=2),\n",
9898
" color=alt.Color('species_id'),\n",
99-
" tooltip=['species_id'],\n",
99+
" tooltip=['species_id', 'median(weight)'],\n",
100100
")"
101101
]
102102
},
@@ -161,7 +161,7 @@
161161
" x=alt.X('date'),\n",
162162
" y=alt.Y('weight').aggregate('median'),\n",
163163
" color=alt.Color('species_id'),\n",
164-
" tooltip=['species_id', 'date'],\n",
164+
" tooltip=['species_id', 'date', 'median(weight)'],\n",
165165
")"
166166
]
167167
},
@@ -178,11 +178,12 @@
178178
"* **Choix du type de marqueurs** à afficher\n",
179179
" * `graphique.mark_line()`\n",
180180
"* **Assigner des variables** à des canaux du graphique\n",
181-
" * `graphique.encode(...)`\n",
182-
" * Différents canaux :\n",
183-
" * `y=alt.Y('count()')`\n",
184-
" * `y=alt.Y('varY').aggregate('stat')`,\n",
185-
" avec les statistiques `'mean'`, `'median'`, etc."
181+
" * `y=alt.Y('varY').aggregate('fonc_agg')`, avec une des [fonctions\n",
182+
" d'agrégation](https://altair-viz.github.io/user_guide/transform/aggregate.html#aggregation-functions) :\n",
183+
" * `'count'`, `'sum'`\n",
184+
" * `'mean'`, `'stdev'`, `'variance'`\n",
185+
" * `'min'`, `'q1'`, `'median'`, `'q3'`, `'max'`\n",
186+
" * Syntaxe courte : `y=alt.Y('fonc_agg(varY)')`"
186187
]
187188
},
188189
{

0 commit comments

Comments
 (0)