[Python] Why are float values stores as string in excel while using polars and openpyxl

Discussão em 'Python' iniciado por Stack, Maio 22, 2025.

  1. Stack

    Stack Membro Participativo

    I'm generating an Excel file using Python, where one column contains either float values (like 12.5, 0.0, etc.) or the string "NA" for missing data. I’m using Polars to structure the data and openpyxl to write to Excel.

    Even though numeric values are float in Python, Excel shows a warning icon saying:


    "Number stored as text"
    ​

    Float values should be saved as real numbers in Excel

    "NA" values should remain as strings

    Excel should not show any warnings for number cells

    Continue reading...

Compartilhe esta Página