Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python replace date time column

df['Date'] = df['Date'].mask(df['Date'].dt.year == 2216, df['Date'] - 
                                                         pd.to_timedelta(200, unit='y') + 
                                                         pd.to_timedelta(12, unit='h'))
print (df)
        Date
0 2016-12-21
1 2016-12-23
2 2016-01-31
3 2016-12-23
4 2016-12-27
5 2016-12-25
6 2016-12-23
Comment

PREVIOUS NEXT
Code Example
Python :: create loop python 
Python :: valid paranthesis 
Python :: server localhost for shar file 
Python :: python to dart converter 
Python :: list of class instances in python 
Python :: How to use a <ComboboxSelected virtual event with tkinter 
Python :: city of stars how many words in a song python code 
Python :: Compress multiple directories but exclude directory - Python zipfile(or anything native to Windows 2012+ 
Python :: genisim 4.0 words 
Python :: browser environment: 
Python :: How to allow discord bot to respond to webhook. Python. Discord.py 
Python :: odoo 12 python version 
Python :: how to add start menu in python 
Python :: How to correctly call url_for and specify path parameters 
Python :: dict python inpmenttion 
Python :: find middle permutation of the string in python list 
Python :: self.stdout.write django 
Python :: ring Search List Item 
Python :: found django install path 
Python :: Hiding and encrypting passwords in Python? 
Python :: how to write stuff in python 
Python :: talib 
Python :: capiatlize first letter in list 
Python :: how to split string into list conditionally+python 
Python :: modwt python github code 
Python :: how to create customer using python api of shopify 
Python :: mail.send_message flask not working, SSL == 465 
Python :: self.tk.call( _tkinter.TclError: unknown option "-relwdth" 
Python :: @action(detail=true) meaning 
Python :: device one list into 2 list python 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =