I have a dataframe with a row that contains the following:
id animal
1 tiger
I would like to simply "set" the value of 1 to, say, "lion".
contains_latlong.iloc[1]["animal"]="lion"
is something that Pandas doesn't like. Being new, I'm getting mixed up with copying vs modifying dataframes, I suppose. The warning is
SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame
What is the way to set a given value of a cell? (And, in general, how should I think about this?)
Edit: str.replace
is not what I'm looking for here. I just want to replace the content of that cell (whatever it is, rather than a regex), with some other string (literal)