I'm trying to use a for loop to populate data in a destination column in an excel spreadsheet. The destination column gets made but then the information from the for loop doesn't print into the excel file.
import pandas as pd
aasb_scores = pd.read_excel ('/Users/nnamdiokoli/Library/Containers/com.microsoft.Excel/Data/Desktop/AASB Scoring PivotTable Example.xlsx',
index=False)
aasb_scores['Average'] = (aasb_scores['Q1'] +
aasb_scores['Q2']+ aasb_scores['Q3'] +
aasb_scores['Q4'] + aasb_scores['Q5'])/5.00
aasb_scores.head(10)
def finalround():
for i in aasb_scores['Average']:
if i >= 3:
print('Final Round')
else:
print('cut')
aasb_scores['Moving on?'] = finalround()
aasb_scores.to_excel('/Users/nnamdiokoli/Library/Containers/com.microsoft.Excel/Data/Desktop/AASB Scoring PivotTable Example.xlsx',
index=False)