Jun-22-2021, 07:57 PM
>>> items 0 1 2 0 Item Type Item Name Price AED 1 laptops HP 2400 2 laptops DELL 3400 3 laptops ACER 1400 >>> >>> df = items.rename(columns=items.iloc[0]).drop(items.index[0]) >>> df Item Type Item Name Price AED 1 laptops HP 2400 2 laptops DELL 3400 3 laptops ACER 1400 >>> df = df.append(pd.Series(), ignore_index=True) >>> df Item Type Item Name Price AED 0 laptops HP 2400 1 laptops DELL 3400 2 laptops ACER 1400 3 NaN NaN NaN >>> >>> print(df.to_string(index=False)) Item Type Item Name Price AED laptops HP 2400 laptops DELL 3400 laptops ACER 1400 NaN NaN NaN