📜  Pandas bins pd.cut() - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:46.958000             🧑  作者: Mango

代码示例1
cut_labels_4 = ['silver', 'gold', 'platinum', 'diamond']
cut_bins = [0, 70000, 100000, 130000, 200000]
df['cut_ex1'] = pd.cut(df['ext price'], bins=cut_bins, labels=cut_labels_4)