I have a python list l.The first few elements of the list looks like below
[751883787]
[751026090]
[752575831]
[751031278]
[751032392]
[751027358]
[751052118]
I want to convert this list to pandas.core.series.Series with 2 leading 0.My final outcome will look like
00751883787
00751026090
00752575831
00751031278
00751032392
00751027358
00751052118
I'm working in Python 3.x in windows environment.Can you suggest me how to do this? Also my list contains around 2000000 elements
you can try:
list=[121,123,125,145]
series='00'+pd.Series(list).astype(str)
print(series)
output:
0 00121
1 00123
2 00125
3 00145
dtype: object
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With