📜  将数据帧存储到范围内 - Python 代码示例

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

代码示例1
def conditions(i): 
    if i <=50: return '0-50'
    if i > 50 and i <=100: return '50-100'
    if i > 100 and i <=250: return '100-250'
    if i > 250 and i <=350: return '250-350'
    if i > 350: return '>350'

df['C']=df['B'].apply(conditions)