Reputation: 5335
Suppose there is a Excel file:
Is there a way to read it directly as a Pandas dataframe with multiindex, without filling blank spaces in the first column?
Upvotes: 0
Views: 287
Reputation: 62503
df = pd.read_excel('test.xlsx')
.ffill()
:df.i0.ffill(inplace=True)
set_index()
:df.set_index(['i0', 'i1'], inplace=True)
Upvotes: 2