Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 282 Bytes

File metadata and controls

14 lines (9 loc) · 282 Bytes
orphan:

The same operation in pandas can be accomplished using the where method from numpy.

.. ipython:: python

   tips["bucket"] = np.where(tips["total_bill"] < 10, "low", "high")
   tips.head()

.. ipython:: python
   :suppress:

   tips = tips.drop("bucket", axis=1)