Suppose I have this data frame:
pd.DataFrame({"A": [1,'3', "4-Very Good"], "B":['1', '2', '3}'], "C": ['Apple', 'Ball', 'Cat'], "D": [1,4,"5-Excellent"]})
Column “A”: 1) I want both 1 and ‘3’ to be converted to float ; 2) do not want to convert ‘4-Very Good’ to NaN.
Column “B”: I want to make each of “1”, “2”, “3” to float.
Column “C”: should be unchanged.
Column “D”: 1)I want to change “1” and “4” to float; 2)do not want to convert “4-Very Good” to NaN.