mercredi 3 juillet 2019

How to do 2 or more things in a if statement?

I have following code:

for f in rawdata:
        if(i == 0):
            df = pd.read_excel(os.path.join(wd_input, f), sheet_name = 0, skiprows = 3)[:-1]
            df2 = pd.read_excel(os.path.join(wd_input, f), sheet_name = None, skiprows = 3)
            df3 = pd.read_excel(os.path.join(wd_input, f), sheet_name = 0, skiprows = 3)[:-1]

 else:
            df = df.append([pd.read_excel(os.path.join(wd_input, f), sheet_name = 0, skiprows = 3)[:-1]], ignore_index = True)
        i += 1

But it is not working. I want to do all three things when the if condition is true

Aucun commentaire:

Enregistrer un commentaire