I am trying to work on the below code:
import pandas as pd
a=pd.Series([123,22,32,453,45,453,56])
b=pd.Series([234,4353,355,453,345,453,56])
df=pd.concat([a, b], axis=1)
df.columns=['First', 'Second']
I wanted to add a new column to this data frame with the first digit from values in column 'First': a) change number to string from column 'First' b) extracting the first character from newly created string c) The results from b save as new column in the data frame
I don't know how to apply this to the pandas' data frame object. I would be grateful for helping me with that.