My question is exactly same with the question
But, my language is Python, not R. So I ask this question again.
I have two time series with different time stamps and a different number of data points.
For example,
first data is
second data is
.
I concatenate two tables into one table.
I want to do two things. First, time index should be in order.
It is easily done by pd.concat([df1, df2], axis=1)
. The result is
The second thing is to replace 'NA' by the most recent data point.
For example, at time 0.1, the value of column 'B' is 2.1 which is the value at time 0.09. In a same manner, the value of columns 'A' at time 0.30 should be 3.0. But still, there is no value at time 0.09 for columns 'A'.
How can I do this second job?
Thank you!