'Pandas unable to assign value to cell

I am trying to assign a value to the Team Name value in the df, I was able to retrieve the value at the cell but when i tried to assign a value to it, it wont reflect the change

Unnamed: 0    Name    Email              Roll Number    Phone Number    Discord Id    Team Name
0        0    Name    [email protected]    1025            9821090000    discordid#4431    NaN

register[register['Discord Id'] == 'discordid#4431']['Team Name']

gives the output

0   NaN 
Name: Team Name, dtype: float64

register[register['Discord Id'] == 'discordid#4431']['Team Name'] = 'Team1' does not reflect any changes in the dataframe can anybody help?



Solution 1:[1]

Is this what you're trying to do?

df['Team Name'] = df['Discord ID']

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 smitty_werben_jagerm