I need to find the columns in data frame, which has numeric values and are stored as string.
data_set = pd.DataFrame({"Number":["1","2","3","4","5"], "Char":["A","B","C","D","E"]})
data_set.dtypes
In above code, column "Number" has numeric values, but stored as string. I have to iterate through columns and convert it to int or float.
I can do it by taking column name and convert it.
data_set["Number"] = data_set["Number"].astype(int)
What i need is to do it dynamically. Dynamically means, iterating through columns and changing it.