I've the following Data Frame.
data = pd.read_csv("Example.csv")
data["Column1"]
Column0 Column1
0 a Gold
1 b Silver
2 b Silver (Running)
3 c Bronze (800m)
4 c Bronze
5 a 2x Gold (500m)
6 a Really Successful, 2x WM Gold (500m)
My Goal is to replace some of the Strings with only the Medals.
data = pd.read_csv("Example.csv")
data["Column1"]
Column0 Column1
0 a Gold
1 b Silver
2 b Silver
3 c Bronze
4 c Bronze
5 a Gold
6 a Gold
7 a Gold
8 a Gold
I've already tried the replace() method. But it doesnt work.
Like this :
data[Column1] = data.replace({"Column1": "Silver"}, "Silver)