Код: Выделить всё
duckdb.sql('select *, row_number() over () as index from df')
Похоже, это так:
Код: Выделить всё
In [11]: df = pl.DataFrame({'a': range(1, 1_280_000)}); duckdb.sql('select *, row_number() over () as index from df qualify a != index').pl()
Out[11]:
shape: (0, 2)
┌─────┬───────┐
│ a ┆ index │
│ --- ┆ --- │
│ i64 ┆ i64 │
╞═════╪═══════╡
└─────┴───────┘
Подробнее здесь: https://stackoverflow.com/questions/790 ... emory-data