[Python] Python - How to check for missing values not represented by NaN?

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

  1. Stack

    Stack Membro Participativo

    I am looking for guidance on how to check for missing values in a DataFrame that are not the typical "NaN" or "np.nan" in Python. I have a dataset/DataFrame that has a string literal "?" representing missing data. How can I identify this string as a missing value?

    When I run usual commands using Pandas like:

    missing_values = df.isnull().sum()

    print(missing_values[missing_values > 0])

    Python doesn't pick up on these cells as missing and returns 0s for the sum of null values. It also doesn't return anything for printing missing values > 0.

    Continue reading...

Compartilhe esta Página