Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经清理了polars文档,看不到从变量创建具有固定值的列的示例。这是有效的pandas:
polars
pandas
df['VERSION'] = version
谢谢
采用polars.lit
polars.lit
import polars as pl version = 6 df.with_column(pl.lit(version).alias('VERSION'))