[Python] Filter series in method chain

Discussão em 'Python' iniciado por Stack, Dezembro 1, 2024.

  1. Stack

    Stack Membro Participativo

    What is the preferred syntax to filter a polars Series without referencing the Series explicitly? I.e. something that works with method chaining. I thought pipe would be an option but it is not available for Series.

    Without method chaining, I would do the following:

    import polars as pl

    ser = pl.Series([1, 2, 3, 4, 5])
    ser = ser.filter(ser > 3)

    Continue reading...

Compartilhe esta Página