Jul-23-2020, 05:55 PM
(This post was last modified: Jul-23-2020, 05:56 PM by Kristenl2784.)
(Jul-23-2020, 05:26 PM)jefsummers Wrote: Still a problem in your if statement - whether true or false it just progresses to the next line and assigns the value to TA.
Personally, I would read the sheet into a Pandas dataframe and use iloc in a loop to find the values, then simply add 9 when found and print that value.
Alternatively, look at using iterrows such as in the article here
I ended up reading it in with Pandas. I'm able to find the string inside the train file. How at this point would I add 9 rows now that the string has been found?
train_file= pd.read_excel(Train,usecols = 'B') string=ws1['A1'].value[28:][:4] train_file[train_file['Name'].str.match(string,na=False)]