-1

2019-05-03 13:08:33.000 America/Los_Angeles

I am having trouble splitting the above mentioned timestamp in different columns.

1 Answers1

0

One way of doing would be to make the date a string and split by the whitespace

Data

df=pd.DataFrame({'date':['2019-05-03 13:08:33.000 America/Los_Angeles']})
df

Split

 df2=df.date.str.split(('\s+'), expand=True)
df2.columns=['DATE','Time','Region']
df2

Merge the two dfs

df.merge(df2, left_index=True, right_index=True)

Outcome

enter image description here

wwnde
  • 26,119
  • 6
  • 18
  • 32