要么我不理解文档或它已过时.
如果我跑
user[["DOC_ACC_DT", "USER_SIGNON_ID"]].groupby("DOC_ACC_DT").agg(["count"]).resample("1D").fillna(value=0, method="ffill")
Run Code Online (Sandbox Code Playgroud)
它得到了
TypeError: fillna() got an unexpected keyword argument 'value'
Run Code Online (Sandbox Code Playgroud)
如果我跑
.fillna(0)
Run Code Online (Sandbox Code Playgroud)
我明白了
ValueError: Invalid fill method. Expecting pad (ffill), backfill (bfill) or nearest. Got 0
Run Code Online (Sandbox Code Playgroud)
如果我然后设置
.fillna(0, method="ffill")
Run Code Online (Sandbox Code Playgroud)
我明白了
TypeError: fillna() got multiple values for keyword argument 'method'
Run Code Online (Sandbox Code Playgroud)
所以唯一有效的是
.fillna("ffill")
Run Code Online (Sandbox Code Playgroud)
但当然这只是一个向前填补.但是,我想NaN用零替换.我在这做错了什么?