Online Python Compiler

import pandas as pd # Example dataframe df = pd.DataFrame({ 'DayNo': [1, 2, 3, 4, 5,6,7], 'Name': ['Sun', 'Mon', 'Tue', 'Wed', 'Thu','Fri','Sat'], 'Qty': [2.6, 5, 11.8, 2, 5.6,0,0.25]}) df_str = df.astype(str) print(df_str.dtypes) #Applying conversion print("After Conversion:") df_num = pd.to_numeric(df_str.DayNo) print('DayNo:',df_num.dtypes)