'How to replace a value in a column

df= df.Year.replace('(P)','', regex=True) print(df)

0 2000 1 2001 2 2002 3 2003 4 2004 5 2005 6 2006 7 2007 8 2008 9 2009() 10 2010()

I am getting this, but i want it to be 2009 and 2010 instead of 2009() and 2010()



Sources

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

Source: Stack Overflow

Solution Source