Eventual-Inc / Daft

Distributed data engine for Python/SQL designed for the cloud, powered by Rust
https://getdaft.io
Apache License 2.0
2.35k stars 166 forks source link

implement `mean` and `stddev` for Decimal128 #3157

Closed universalmind303 closed 2 weeks ago

universalmind303 commented 3 weeks ago

Is your feature request related to a problem?

i want to run mean and stddev on decimal dtypes

Describe the solution you'd like

import daft
from daft import col, lit

d_col = col("floats").cast(daft.DataType.decimal128(5, 2))
df = (
    daft.from_pydict({"floats": [328.00, 300.00]})
    .agg(d_col.stddev())
    .collect()
)
df

Describe alternatives you've considered

casting to floats, but this may lose some precision.

Additional Context

No response

Would you like to implement a fix?

No