0
Column is in this format :  Wed Dec 26 09:06:00 IST 2018

I want to separate in columns like Day,Month,Time,Time zone,Year in python

  • Please could you provide some more information, such as a sample of your dataframe. This might help: https://stackoverflow.com/questions/35595710/splitting-timestamp-column-into-separate-date-and-time-columns – bm13563 Jun 12 '20 at 21:26
  • are all the time zones `IST` ? – Umar.H Jun 12 '20 at 21:30

1 Answers1

0

You can use the str.split method with expand=True. Make sure to rename the columns.

df = pd.DataFrame({'col': ["Wed Dec 26 09:06:00 IST 2018"]})
df = df.col.str.split(expand=True)
df.columns = ['Day','Month','Day of month', 'Time','Time zone','Year']
df
   Day Month Day of month      Time Time zone  Year
0  Wed   Dec           26  09:06:00       IST  2018