I want to replace all numerical values in a DataFrame column with NaN
Input
A B C
test foo xyz
hit bar 10
hit fish 90
hit NaN abc
test val 20
test val 90
Desired Output:
A B C
test foo xyz
hit bar NaN
hit fish NaN
hit NaN abc
test val NaN
test val NaN
I tried the following:
db_old.loc[db_old['Current Value'].istype(float), db_old['Current Value']] = np.nan
but returns:
AttributeError: 'Series' object has no attribute 'istype'
Any suggestions?
Thanks