【发布时间】:2022-08-15 17:49:47
【问题描述】:
北极熊猫中的drop_duplicates() 相当于什么?
import polars as pl
df = pl.DataFrame({\"a\":[1,1,2], \"b\":[2,2,3], \"c\":[1,2,3]})
df
输出:
shape: (3, 3)
┌─────┬─────┬─────┐
│ a ┆ b ┆ c │
│ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ i64 │
╞═════╪═════╪═════╡
│ 1 ┆ 2 ┆ 1 │
├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┤
│ 1 ┆ 2 ┆ 2 │
├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┤
│ 2 ┆ 3 ┆ 3 │
└─────┴─────┴─────┘
代码:
df.drop_duplicates([\"a\", \"b\"])
提供以下错误:
AttributeError:未找到 drop_duplicates
标签: python python-polars