[Python] Unable to get all rows from csv based on some column value [duplicate]

Discussão em 'Python' iniciado por Stack, Novembro 20, 2024.

  1. Stack

    Stack Membro Participativo

    I am confused about how to get all the matching some value, I went through to all the related post on such topic on stackoverflow, what I have right now should be working, I am unsure either this csv is corupted, or am I making some mistake, so far I have this:

    Data Sample [​IMG]

    Now if I try to get the rows based on School Name, it works:

    df_masterdb[df_masterdb['School Name'] == "Daniel Pratt Elementary School"]


    [​IMG]

    But if I try to get rows based on State_abrr, it fetches me nothing:

    df_masterdb[df_masterdb['State_abrr'] == "AL"]


    [​IMG]

    Every column is working as expcted and fetches me all the required rows by above method but this "State_abrr" column fetches me nothing. Am I missing something here?

    Continue reading...

Compartilhe esta Página