I have a dataframe from which I need to replace all strings in column sense where the string is exactly pertain. I can apply the following code to do the same
pd[pd['sense'] == 'pertain']['sense'].str.replace('pertain','pertaining')
But this does not take effect on the original dataframe. How can I make sure that the effect takes palce on the original dataset and all the pertain in the column will change to pertaining
| affix | word | sense | meaning |
0 ical neuroanatomical pertaining of or pertaining to [[neuroanatomy]]
1 ical neuroanatomical pertain of or pertaining to [[neuroanatomy]]
2 ical biotechnological pertaining of or pertaining to [[biotechnology]]
3 ical biotechnological pertain of or pertaining to [[biotechnology]]
4 ical educological relating relating to [[educology]].
So Ideally, after the operation my output should look like the following
| affix | word | sense | meaning |
0 ical neuroanatomical pertaining of or pertaining to [[neuroanatomy]]
1 ical neuroanatomical pertaining of or pertaining to [[neuroanatomy]]
2 ical biotechnological pertaining of or pertaining to [[biotechnology]]
3 ical biotechnological pertaining of or pertaining to [[biotechnology]]
4 ical educological relating relating to [[educology]].