[Python] Issue with reading a csv file with all columns as string using polars

Discussão em 'Python' iniciado por Stack, Abril 27, 2025.

  1. Stack

    Stack Membro Participativo

    I have below python code using polars and I do not want python to auto parse values as dates or integers unless explicitly stated. schema_overrides doesn't prevent auto conversion either.


    # Read the CSV file with all columns as strings using schema_overrides
    file_path = "./xyz.csv"
    df = pl.read_csv(file_path, schema_overrides={'*': pl.Utf8})

    # Display the DataFrame
    print(df)


    I get below error: polars.exceptions.ComputeError: could not parse p35038 as dtype i64 at column 'Employee ID' (column number 3)

    Continue reading...

Compartilhe esta Página