I have a pandas df that looks like this:
I'm trying to split up the Gun_Time and Net_Time columns by adding a ':' after every 2 numbers.
I've tried some regex with a simple function but have been unable to come up with the correct solution to correctly insert a ':' after every 2 numbers. How could I achieve this?
You can use a lambda function and apply. Are you trying to convert these values into timestamps ?
df.Gun_Time.astype(str).apply(lambda s: s[:2] + ':' + s[2:])