Python Programming Question Two Dataframes Let S Call Dfa Dfb Dfa Datetime One Column Valu Q37256728

Python Programming Question.

I have two dataframes, let’s call them DFA and DFB

DFA has datetime in one column and values in the next likeso:

DatetimeValues10:00 AM

500

11:00 AM250

DFB has Values only. How can I get the SIMILAR values anddatetimes that are found in both dataframes into a singulardataframe?


Answer


import numpy as npimport pandas as pd

df1 = pd.DataFrame({‘Datatime’: [’10:00AM’, ’11:00AM’]})

  

df2 = pd.DataFrame({‘Values’: [‘500’, ‘250’]})

df1.join(df2)

thats the program

please import the packages

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.