Do the same with .assign() instead, returning a new frame with a price column
pandas · from Adding and changing columns
df["new"] =.assign()np.wherepd.cut.loc[mask, col] =Copy-on-WritePutting the kettle on…
Starting up…
Exercise 2
Do the same with .assign() instead, returning a new frame with a price column.
your answer
stuck? the lesson behind it
Adding and changing columns
Creating columns, and the chained assignment that silently does nothing.