pandas cut函數快速自定義分類

數據如圖所示 生成未下單間隔列 df['未下單間隔']=df.最近下單時間.map(lambda x :\                           round((pd.to_datetime('2018-04-08')-pd.to_datetime(x[:10])).total_seconds()/(24*60*60))) df['未下單分類']=pd.cut(df.未下單間隔,bin
相關文章
相關標籤/搜索