Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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]
Comment

PREVIOUS NEXT
Code Example
Python :: adding numbers using python function 
Python :: clear cookies selenium python 
Python :: shutil move overwrite 
Python :: how to make custom buttons tkinter 
Python :: python replace string in file 
Python :: how to compare two text files in python 
Python :: python mysqldb 
Python :: python if string is null or whitespace 
Python :: df drop index 
Python :: How to install XGBoost package in python on Windows 
Python :: how to create random tensor with tensorflow 
Python :: pandas save one row 
Python :: blinking an led with raspberry pi 
Python :: python read line into list 
Python :: how to create obtain any random 3 items of list in python 
Python :: all the positions of a letter occurrences in a string python 
Python :: Write a python program to find the most frequent word in text file 
Python :: declare numpy zeros matrix python 
Python :: code to find the shape of the 2d list in python 
Python :: python for loop in one line 
Python :: python get input from console 
Python :: How to return images in flask response? 
Python :: datetime utcnow 
Python :: how to close a webpage using selenium driver python 
Python :: how do you see if a data type is an integer python 
Python :: how to read text frome another file pythion 
Python :: basemap python 
Python :: python ascii 
Python :: case in python 
Python :: python numpy array delete multiple columns 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =