Answers for "how to add 30 minutes in datetime column in pandas"

0

how to add 30 minutes in datetime column in pandas

df['time'] = pd.to_datetime(df['time'].astype(str)) + pd.DateOffset(hours=5, minutes=30)

print(df['time'].head())

0   2018-12-24 10:20:00
1   2018-12-24 10:20:00
2   2018-12-24 10:30:00
3   2018-12-24 10:42:00
4   2018-12-24 11:34:00
Name: 1, dtype: datetime64[ns]
Posted by: Guest on July-01-2021

Code answers related to "how to add 30 minutes in datetime column in pandas"

Python Answers by Framework

Browse Popular Code Answers by Language