I have a pandas Dataframe:
date time user_id
0 20160921 5947 13079492369730773513
1 20160921 5948 13079492369730773513
2 20160921 235949 13079492369730773513
3 20160921 235950 13079492369730773513
4 20160921 235951 13079492369730773513
I want to format the 'time' column into:
date time user_id
0 20160921 005947 13079492369730773513
1 20160921 005948 13079492369730773513
2 20160921 235949 13079492369730773513
3 20160921 235950 13079492369730773513
4 20160921 235951 13079492369730773513
I know the list comprehension way:
df['time'] = ["%06d" % t for t in df['time'].tolist()]
Is there any vectorized method to do the same trick? And how to do this if it is a Dask Dataframe?