Nov-22-2019, 11:33 PM
You need to clarify what means "the student progresses" in terms of column values. Honestly, I don't understand what does it mean, probably, student's progress implies that values in the second column of the array are greater corresponding values in its third column.
If so, you can write this condition easily:
If so, you can write this condition easily:
results[:, <appropriate column selector1>] > results[:, <appropriate column selector2>]
. That would be a one-line solution which you are looking for. The third part of the assignment likely assumes that you solved the second one. Given a Boolean mask, e.g. mask = np.array([True, True, False, False]), you can do names[mask]
and results[mask]
. It is highly recommended to look into NumPy tutorial.