In [7]:
import pandas as pd
import numpy as np
df = pd.DataFrame(
{"x": [3, 3, 1, 10, 1, 10], "y": [1, 2, 3, 4, 5, 60], "z": [6, 5, 4, 3, 2, 1]}
)
df
Out[7]:
In [8]:
pd.cut(df.y, 3)
Out[8]:
In [9]:
pd.cut(df.y, [0, 1.5, 4.5, 100])
Out[9]:
In [10]:
pd.cut(df.y, [1.5, 4.5, 10])
Out[10]:
In [ ]: