Skip to content

Commit

Permalink
fix[rust]: Improve DataFrame.describe() percentage formatting (#4823)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang12zheng committed Sep 13, 2022
1 parent 051c087 commit e2edab3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions polars/polars-core/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2396,11 +2396,11 @@ impl DataFrame {
/// ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
/// │ min ┆ null ┆ 1.0 ┆ null │
/// ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
/// │ 0.25% ┆ null ┆ 1.5 ┆ null │
/// │ 25% ┆ null ┆ 1.5 ┆ null │
/// ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
/// │ 0.5% ┆ null ┆ 2.0 ┆ null │
/// │ 50% ┆ null ┆ 2.0 ┆ null │
/// ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
/// │ 0.75% ┆ null ┆ 2.5 ┆ null │
/// │ 75% ┆ null ┆ 2.5 ┆ null │
/// ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
/// │ max ┆ null ┆ 3.0 ┆ null │
/// └──────────┴─────────────┴─────────┴────────┘
Expand Down Expand Up @@ -2445,7 +2445,7 @@ impl DataFrame {
.quantile(*p, QuantileInterpolOptions::Linear)
.expect("quantile failed"),
));
headers.push(format!("{}%", *p));
headers.push(format!("{}%", *p * 100.0));
}

// Keep order same as pandas
Expand Down

0 comments on commit e2edab3

Please sign in to comment.