修改包含nan的pandas列的值

我没有找到像我这样的问题...

btw I have a df with a column "Year" like this:

2009)
1998)
2000)
1980)
2002)
nan
nan
nan
2014)
1973)
nan

I want to cut off the parenthesis, but when I use data['Year'] = data['Year'][:-1] notihng appens (not even errors)

if I use data['Year'] = data['Year'].apply(lambda x: x[:-1]) it gives me

TypeError: 'float' object is not subscriptable

我猜问题出在“ nan”值上,但是我如何解决这个问题? maye也可以将nans转换为0。

非常感谢