[Python] Python Polars: How to add columns in one lazyframe to another lazyframe?

Discussão em 'Python' iniciado por Stack, Fevereiro 5, 2025.

  1. Stack

    Stack Membro Participativo

    I have a LazyFrame in Python and I would like to add to it columns from another LazyFrame. The two LazyFrames have the same number of rows and different columns.

    Doing the below does not work because with_columns expects an iterable

    def append_columns(df:pl.LazyFrame):
    df2 = pl.LazyFrame([1,2])
    return df.with_columns(df2)

    Continue reading...

Compartilhe esta Página