This might be a simple question but I tried searching for the answer and I can't seem to find it. I have a pandas dataframe and I want to change the value of some cells to a tuple.
So if I have this:
Col0 Col1 Col2
3 a 6
7 b 8
I would like to change all the "a" values to a tuple:
Col0 Col1 Col2
3 (4,5) 6
7 b 8
I tried doing this:
df.loc[df["Col1"] == "a"] = (4,5,)
but it obviously didn't work. I don't know how I can do this.
How can I do this?