Это минимальное повторение проблемы:
Код: Выделить всё
import polars as pl
# Create a DataFrame
df = pl.DataFrame({"category": ["A", "A", "B", "B", "B"],
"value": [1., 2., 3., 4., 5.]})
# Group by 'category' and sum 'value'
result = df.group_by("category").agg({"value": pl.sum})
# Print the result
print(result)
Код: Выделить всё
TypeError: specifying aggregations as a dictionary is not supported
Код: Выделить всё
┌──────────┬─────────────────┐
│ category ┆ value │
│ --- ┆ --- │
│ str ┆ list[f64] │
╞══════════╪═════════════════╡
│ A ┆ 3.0 │
│ B ┆ 12.0 │
└──────────┴─────────────────┘
Подробнее здесь: https://stackoverflow.com/questions/760 ... dictionary