看板 Python 關於我們 聯絡資訊
各位大大們好, 在網路上查到這篇在教CLV建模 https://www.twblogs.net/a/5c37876abd9eee35b3a59e44 不過在執行 data = summary_data_from_transaction_data(df, 'CustomerID', 'InvoiceDate', monetary_value_col='Sales', observation_period_end='2011-12-9') 跳出 TypeError: float() argument must be a string or a number, not 'Day' 我也嘗試更換檔案中日期型態(str、int),但一樣不行 想跟板上大大請教該怎麼處理,非常感謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.215.149.61 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1600101742.A.EC5.html
TitanEric: 試試pd.to_datatime 09/15 10:04
dean8462: 我將表單中唯一的日期做df['InvoiceDate'] = pd.to_date 09/15 13:50
dean8462: time(df['InvoiceDate']),但執行後還是跟上面一樣..請 09/15 13:50
dean8462: 問還有什麼方式可以試試看嗎QQ 09/15 13:50
TitanEric: 我實際跑過之後可以正常跑優 我是用Lifetimes 0.11.3 09/15 19:13
dean8462: 沒問題了,感謝T大!!! 09/16 00:42