I am trying to apply the function on multiple data frames. I created a list for the data frames. If the ranking is less than 100, high performance column would be assigned values copied over from the ranking column and if the ranking is between 100 and 200, the average column would be assigned the values copied over from the ranking column. If the ranking is between 200 and 300, the lower performance column gets assigned values copied from the ranking column. I do not get any error messages when I run the script but the function does not get applied to the data frames. Any suggestions would be helpful.
for file in tests: #tests would be a list of data frame
def func (file):
if (file['ranking']) < 100:
(file['ranking']) == (file['High Performance'])
elif (file['ranking']) > 100 & (file['ranking'] < 200):
(file['ranking'])== (file['Average'])
elif (file ['ranking']) > 200& (file['ranking'] < 300):
(file['ranking']) == (file ['Low Performance'])
else:
return ''
file['High Performance'] = file.apply(func, axis=1)
file['Average'] = file.apply(func, axis=1)
file['Low Performance'] = file.apply(func, axis=1)