By Hemanta Sundaray on 2021-08-31
First, let’s read two Excel worksheets into two different Dataframes:
import pandas as pd
df1 = pd.read_excel('budget.xlsx')
df2 = pd.read_excel('budget.xlsx', sheet_name="Sheet2")
df1.head()
Output:
df2.head()
Output:
Next, we will combine both the Dataframes by alternating the rows:
df3 = pd.concat([df1, df2]).sort_index()
df3.head()