PANDAS: How do a copy a value in pandas from a dataframe to another dataframe based on different cells
You can use the map function for the pandas series:
Map the df2['Ship_Date'] to the values of df1['Price'], and store the mapped series in your 'Price' column of the df2. The mapping argument has to be a pandas series with the index 'Ship_Date'.It can be done by setting the df1 index to the 'Ship_Date' and selecting the 'Price' column.
df2['Price'] = df2['Ship_Date'].map(df1.set_index('Ship_Date')['Price'])
I have df1




Ship_Date
Price




07/15/2014
5


08/19/2015
9


09/20/2016
7




I also have df2




Ship_Date




08/19/2015


07/15/2014


09/20/2016


07/15/2014




I need the final output for df2 to be




Ship_Date
Price




08/19/2015
9


07/15/2014
5


09/20/2016
7


07/15/2014
5




I also already added the 'Price' Column for df2. I need help setting the values in each cell for the 'Price' column to be the price corresponding to the date in df1