I found the syntax error and this can now be considered resolved roster.iloc[:, 2:10] to be replaced by roster.columns[2:10]