mardi 22 mai 2018

How to insert values from if function into an array with openpyxl in python?

Here I'm trying to run through an excel file in columns A and D. I'm trying to create a one column array of values from column A where a condition for Column D is true. I'm not sure how to have the corresponding values from column A be input into the array. I'm also very new to coding and don't know a lot of what I'm doing, any advice is appreciated.

for cell in clf['D']: #iterates through column D
if cell.value == 0:
    #insert into empty array corresponding values from column A 
    np.insert(array,0,clf['A'])
else:
    pass`

Aucun commentaire:

Enregistrer un commentaire