Python Forum
Basic Boolean homework help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic Boolean homework help
#3
(Nov-22-2019, 11:33 PM)scidam Wrote: 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: 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.

A student progresses to the next year if they have an average of 40% or more (the first column of numbers gives the average score for each student) and they have no hard-fails (the last column gives this info - only Bob has a hard fail).
Reply


Messages In This Thread
Basic Boolean homework help - by StillAnotherDave - Nov-22-2019, 09:14 PM
RE: Basic Boolean homework help - by scidam - Nov-22-2019, 11:33 PM
RE: Basic Boolean homework help - by StillAnotherDave - Nov-23-2019, 02:53 PM
RE: Basic Boolean homework help - by ibreeden - Nov-24-2019, 10:06 AM
RE: Basic Boolean homework help - by scidam - Nov-25-2019, 08:45 AM
RE: Basic Boolean homework help - by perfringo - Nov-27-2019, 10:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Homework advice - Boolean function, whole-word values musicjoeyoung 4 3,363 May-07-2020, 06:10 PM
Last Post: musicjoeyoung

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020