[Python] i get SettingWithCopyWarning wjen i try to add new column into Datafram [duplicate]

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

  1. Stack

    Stack Membro Participativo

    when I try to add a new date into my datafram I got this warning :

    dateSelect = '2016-11-06'
    df['dates'] = dateSelect


    the warning whicj=h i got : `SettingWithCopyWarning:

    A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead`

    is it normal, what shold I do to avoid this warning ? thanks

    `SettingWithCopyWarning:

    A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead`

    Continue reading...

Compartilhe esta Página