Skip to content
Advertisement

Tag: timestamp

Compare two DataFrames and find missing timestamps

I have the following two dataframes: and in df2 I have some missing timestamps compared to df1. I am able to find those timestamps using the following code: I want to populate those missing timestamps in df2 and fill in the values of the columns with the average value of the two previous rows. So the new df2 should look

Create a dataframe containing all weekends in a given year

Good afternoon, I would like to create a function that, given a year, would return a dataframe with all the dates in Timestamp format related to the Saturdays and Sundays of that year. That is to say: The function would return: If you can tell me an optimal way to get that dataframe I would be grateful. Answer Well here’s

Advertisement