Not able to change the value of a data-frame column using Python

for ind in data6.index:
    if(data6['Label'][ind]>0):
        data6['Label'][ind]=1
        
data6

I am trying to set values greater than equal to 1 in the data-frame to 1

enter image description here

The error I am getting is:

SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy data6[‘Label’][ind]=1

Answer

This worked

data6['Label'].values[data6['Label'].values > 0] = 1
data6