I have two pandas DataFrames df1 and df2 and I want to transform them in order that they keep values only for the index that are common to the 2 dataframes.
df1
reindex + dropna
reindex
dropna
df1.reindex(df2.index).dropna() Out[21]: values1 28/11/2000 -0.055276 29/11/2000 0.027427 30/11/2000 0.066009 df2.reindex(df1.index).dropna() Out[22]: values2 28/11/2000 -0.026316 29/11/2000 0.015222 30/11/2000 -0.024480