'pandas.read_excel() is only passing the first line of the excel sheet as a dataframe label

I am trying to read an Excel file using pandas.read_excel(). The function is only picking up the very first row of the sheet I am passing and it is returning a 0 by 1 dataframe. Not only it just takes the first row, but it sets it as the dataframe label. I tried passing the path as a handle but it did the same result

def read_excel_report(path):
    try:
        #handle = open(path)
        dictionary
        # representing a different worksheet.
        raw_excel = pd.read_excel(path, sheet_name=-1, engine='openpyxl')
        raw_excel = raw_excel.fillna('')

        print("data extracted")
        return raw_excel
    except Exception as e:
        print(e)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source