Python reads excel and stores it in the list according to the header hash copy.deepcopy



def getInfoOfInputFile(input_file_path):

    global info
    info = []
    temp = {}
    getInfo = pd.read_excel(os.path.join(os.getcwd()+'\\input', input_file_path), sheet_name="frequency_plan", dtype=str, keep_default_na=False)

    columns = getInfo.columns.size  
    rows = getInfo.iloc[:, 0].size  

    for i in range(0, rows):
        temp['MAINFLOW'] = getInfo['MAINFLOW'][i]
        temp['SUBFLOW'] = getInfo['SUBFLOW'][i]
        temp['TESTSTUITE'] = getInfo['TESTSTUITE'][i]
        temp['SPEC'] = getInfo['SPEC'][i]
        temp['TESTMOTHED'] = getInfo['TESTMOTHED'][i]
        temp['PARA'] = ''
        for j in range(5, columns):  # parameters start from column 6
            if(getInfo.iat[i, j] == ''):
                pass
            else:
                temp['PARA'] += ((getInfo.iat[i, j])+'\n\t\t\000')
        print(temp['PARA'])
        print("*******************************")
        info.append(copy.deepcopy(temp))
    # return info


Read More: