Pandas merge and retain the index

Pandas merge and retain the index

A similar question was asked in How to keep index when using pandas merge, but it will not work with MultiIndexes, i.e,
a = DataFrame(np.array([1,2,3,4,1,2,3,3]).reshape((4,2)), columns=['col1','to_merge_on'], index=['a','b','a','b'])
id = 
Read more

Python pandas, how to only plot a DataFrame that actually have the datapoint and leave the gap out

Python pandas, how to only plot a DataFrame that actually have the datapoint and leave the gap out

I have a DataFrame with intraday data indexed with DatetimeIndex
df1 =pd.DataFrame(np.random.randn(6,4),index=pd.date_range('1/1/2000',periods=6, freq='1h'))
df2 =pd.DataFrame(np.random.randn(6,4),index=pd.date_range('1/2/2000',periods=6, freq='1h'))
df3 
Read more