I have a big dataframe of datetime and values so I will just be taking a sample dataframe called df1
DateTime Values
2020-12-26 14:00:00 439.0
2020-12-26 14:00:00 441.0
2020-12-26 14:00:00 461.0
2020-12-27 08:00:00 536.0
2020-12-27 08:00:00 547.0
2020-12-27 08:00:00 484.0
2020-12-27 08:00:00 497.0
2020-12-27 14:00:00 491.0
2020-12-27 14:00:00 512.0
2020-12-27 14:00:00 529.0
2020-12-27 14:00:00 436.0
and I have another full dataframe df 2
DateTime Trend
2020-12-18 14:00 no trend
2020-12-19 08:00 no trend
2020-12-19 14:00 no trend
2020-12-21 08:00 no trend
2020-12-21 14:00 no trend
2020-12-22 08:00 no trend
2020-12-22 14:00 decreasing
2020-12-23 08:00 no trend
2020-12-23 14:00 no trend
2020-12-24 08:00 no trend
2020-12-24 14:00 no trend
2020-12-25 08:00 no trend
2020-12-25 14:00 decreasing
2020-12-26 08:00 no trend
2020-12-26 14:00 decreasing
2020-12-27 08:00 no trend
2020-12-27 14:00 no trend
I am trying to create a new column df1[Trend] and assign the trend values based on the right date time
The result should be like this
DateTime Values Trend
2020-12-26 14:00:00 439.0 decreasing
2020-12-26 14:00:00 441.0 decreasing
2020-12-26 14:00:00 461.0 decreasing
2020-12-27 08:00:00 536.0 no trend
2020-12-27 08:00:00 547.0 no trend
2020-12-27 08:00:00 484.0 no trend
2020-12-27 08:00:00 497.0 no trend
2020-12-27 14:00:00 491.0 no trend
2020-12-27 14:00:00 512.0 no trend
2020-12-27 14:00:00 529.0 no trend
2020-12-27 14:00:00 436.0 no trend
Is there anyway I could it?