[Python] Why is df.fillna() only filling some rows and the first column

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

  1. Stack

    Stack Membro Participativo

    I am trying to fill all empty spots in rows and columns with [], however fillna() will only do some rows and the first column. My code has worked in previous runs, so I'm not sure what happened.

    df = df.fillna(value = "[]")
    print(df[['keywords']])
    df.to_csv(r'C:\Users\user\dfexport.csv', index=False, header=True)


    When looking at the CSV file, it looks like this:

    [​IMG]

    The print statement looks like this:

    print(df[['keywords']])


    [​IMG]

    Continue reading...

Compartilhe esta Página