我試過了
df3.at[294,'Initial Effective Date'].str.replace("5/26/19 and 8/2/20","8/2/20")
我的資料框(df3)有多列和 300 行資料。我有一個名為初始有效日期的列,我只想像上面那樣替換第 294 行的一個單元格。但我收到一條錯誤訊息,提示屬性錯誤:“str”物件沒有屬性“str”
uj5u.com熱心網友回復:
嘗試
df3.at[294,'Initial Effective Date'] = "8/2/20"
.str.replace()方法適用于系列,你只得到一個單元格(字串).at()
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/455927.html
