Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to add another timestamp column plus two hours

    from datetime import timedelta
    two_hours = pd.Timedelta(hours=2)
    df["dummy_date"] = df["Date_Time"] + two_hours
    df

    Date_Time               Date    Duration    value   Remark      dummy_date
0   2018-08-14 02:00:00     2018-08-14    3     4     e         2018-08-14 04:00:00
1   2018-08-14 01:00:00     2018-08-14    0     3     o         2018-08-14 03:00:00
2   2018-08-14 00:00:00     2018-08-14    0     2     k         2018-08-14 02:00:00
3   2018-08-13 23:00:00     2018-08-13    10    1     x         2018-08-14 01:00:00
4   2018-08-13 22:00:00     2018-08-13    2     0     c         2018-08-14 00:00:00
5   2018-08-13 21:00:00     2018-08-13    20    23    z         2018-08-13 23:00:00
6   2018-08-13 20:00:00     2018-08-13    1     22    a         2018-08-13 22:00:00
Comment

PREVIOUS NEXT
Code Example
Python :: test if instance in queryset django 
Python :: palindrome without using string function in python 
Python :: powershell open file with default program 
Python :: disable network on pytest 
Python :: matplotlib draw line between subplots 
Python :: django force download file 
Python :: how do i add new items to a dictionary within a for loop python 
Python :: python paragraph Pypi 
Python :: mechanize python #9 
Python :: finda argument index 
Python :: python profile is not defined line_profiler 
Python :: How do I select certain columns for regression plots 
Python :: > not supported between tuple and int 
Python :: convert a python object and store it in a JSON file in the local system 
Python :: time vs timeit 
Python :: raise httperror(req.full_url, code, msg, hdrs, fp) urllib.error.httperror: http error 429: too many requests 
Python :: # difference between list 1 and list 2 
Python :: python math.trunc 
Python :: get ggplot colorpalette python 
Python :: search a number in 2d sorted 
Python :: Code Example of Comparing None with False type 
Python :: online c compiler and exe file 
Python :: install Social Auth App Flask 
Python :: godot get the closer node from array 
Python :: python 2 pages 
Python :: find a paragraph in requests-html 
Python :: Updating hash password in python 
Python :: how to convrete .npz file to txt file in python 
Python :: add a new field to a Hosted Feature Layer 
Python :: pytorch Jaccard Index 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =