dimanche 9 août 2020

I got problem with the length of dataframe while using pandas

a=0
for i in range (0,len(df)):
    if df['column name'][i][7]!='1' or df['column name'][i][7]='6':
        a=a+1   

If i run this piece of code, I got error "string index out of range". Can someone help me to solve this problem. P.S. df has about 10 million rows

Aucun commentaire:

Enregistrer un commentaire