Skip to content

Commit ebca985

Browse files
Change handling precision (#361)
* precision * Automated changes * Automated changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent bdf396d commit ebca985

File tree

1 file changed

+1
-1
lines changed
  • content/course/modelisation/0_preprocessing

1 file changed

+1
-1
lines changed

content/course/modelisation/0_preprocessing/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ df2 = votes.set_index("GEOID").loc[: , ["winner", "votes_gop",
336336
g1 = sns.heatmap(df2.drop("winner", axis = 1).corr(), cmap='coolwarm', annot=True, fmt=".2f")
337337
338338
## Construction directement avec pandas également possible
339-
g2 = df2.drop("winner", axis = 1).corr().style.background_gradient(cmap='coolwarm').set_precision(2)
339+
g2 = df2.drop("winner", axis = 1).corr().style.background_gradient(cmap='coolwarm').format('{:.2f}')
340340
```
341341

342342
La matrice construite avec `seaborn` (question 2) aura l'aspect suivant:

0 commit comments

Comments
 (0)