Df['column']
123
567789476
900XXX444ABCJJJ863XXX
0
2748462838583627484
STITISTISTISTIXXXXXXXXXXXX
836XXX738JJJ484ZZZ838ZZZ
33
269EEHHJ
8888
I TRIED
Df['column']=Df['column'].str[:3]
Output
Nan
Nan
900
Nan
Nan
STI
836
Nan
269
Nan
I tried all possblie way to change the dtype of the column to string but it remains as object only
nan
in output, why not123
as I see900
, how you splitting123
is stored as a number, while900XXX444ABCJJJ863XXX
is a string