I have a dataframe :
A B
10.1 33.3
11.2 44.2s
12.3 11.3s
14.2s *
15.4s nan
i want output as
A B
10.1 33.3
11.2 44.2
12.3 11.3
14.2 0
15.4 0
How do I remove these tailing alphabets I have tried this code
1st approch:
bulb_temp_df['A'].str.extract('(\d)').astype(float)
bulb_temp_df['B'].str.extract('(\d)').astype(float)
2nd approch:
bulb_temp_df['A'] =
bulb_temp_df['A'].astype(str)
bulb_temp_df['A'] =
bulb_temp_df['A'].map(lambda x: x.rstrip('aAbBcC'))
These are not working. They are not removing the tailing s from the columns.