Код: Выделить всё
import polars as pl
df = pl.DataFrame({'index': [1,2,3,2,1],
'object': [1, 1, 1, 2, 2],
'period': [1, 2, 4, 4, 23],
'value': [24, 67, 89, 5, 23],
})
Код: Выделить всё
df.col('value').last().over('index').alias('last')Подробнее здесь: https://stackoverflow.com/questions/731 ... rom-pandas