Skip to content

Commit

Permalink
implicitly groupby without selection and return all column that suppo…
Browse files Browse the repository at this point in the history
…rt the operation
  • Loading branch information
ritchie46 committed Oct 3, 2020
1 parent e84f7f7 commit 69fb36d
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 133 deletions.
4 changes: 2 additions & 2 deletions examples/iris_classifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn enforce_schema(mut df: DataFrame) -> Result<DataFrame> {
df.may_apply(field.name(), |col| match dtype {
ArrowDataType::Float64 => col.cast::<Float64Type>(),
ArrowDataType::Utf8 => col.cast::<Utf8Type>(),
_ => return Err(PolarsError::Other("unexpected type".to_string())),
_ => return Err(PolarsError::Other("unexpected type".into())),
})?;
}
Ok(())
Expand All @@ -142,7 +142,7 @@ fn normalize(mut df: DataFrame) -> Result<DataFrame> {

match ca.sum() {
Some(sum) => Ok(ca / sum),
None => Err(PolarsError::Other("Nulls in column".to_string())),
None => Err(PolarsError::Other("Nulls in column".into())),
}
})?;
}
Expand Down

0 comments on commit 69fb36d

Please sign in to comment.