Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pd combine date time

If df.Date and df.Time are of type str:
pd.to_datetime(df.Date + ' ' + df.Time)

If df.Date and df.Time are of type datetime.date and datetime.time respectively:
pd.to_datetime(df.Date.astype(str) + ' ' + df.Time.astype(str))
Comment

PREVIOUS NEXT
Code Example
Python :: how to convert an image to matrix in python 
Python :: np.loadtext 
Python :: python check numpy arrays equal 
Python :: printing with format float to 2 decimal places python 
Python :: django validator min max value 
Python :: how to draw a bar graph in python 
Python :: python time in nanoseconds 
Python :: selenium webdriver python 
Python :: python filename without extension 
Python :: python print do not use scientific notation 
Python :: python - exchange rate API 
Python :: python split sentence into words 
Python :: find max value index in value count pandas 
Python :: print type(x) in python 
Python :: sort tuple list python 
Python :: check python version conda env 
Python :: python colorama example 
Python :: plt axis label font size 
Python :: user nextcord interactions 
Python :: pandas replace values with only whitespace to null 
Python :: pip install vlc 
Python :: Python terminal colour 
Python :: python turtle background image 
Python :: install python 3.9 centos8 
Python :: AdaBoost in Python 
Python :: post request python 
Python :: ipython read audio file 
Python :: Python - Count the Number of Keys in a Python Dictionary 
Python :: how to print in pyhton 
Python :: ipython on cmd 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =