Set cups to 0 for every row over 100, and return the frame
pandas · from Adding and changing columns
df["new"] =.assign()np.wherepd.cut.loc[mask, col] =Copy-on-WritePutting the kettle on…
Starting up…
Exercise 4
Set cups to 0 for every row over 100, and return the frame. The starter uses chained assignment and silently does nothing — fix it.
your answer
stuck? the lesson behind it
Adding and changing columns
Creating columns, and the chained assignment that silently does nothing.