我有以下代碼:
df = df_final[['p1','p2']].copy()
dff = df_final[['p2','p3']].copy()
dfff = df_final[['p3','p1']].copy()
df_input_output = pd.DataFrame(columns = range(2))
df_input_output.columns = ['1','2']
df_input_output.append(df,ignore_index=True)
df_input_output.append(dff,ignore_index=True)
df_input_output.append(dfff,ignore_index=True)
print(df_input_output)
回傳: error_code
我不知道為什么,我檢查了 copy() 函式是否有效,并且 df、dff、dfff 中有值。
提前致謝, 亞歷山大
uj5u.com熱心網友回復:
您需要捕獲回傳值
df_input_output = df_input_output.append(df,ignore_index=True)
df_input_output = df_input_output.append(dff,ignore_index=True)
df_input_output = df_input_output.append(dfff,ignore_index=True)
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/425883.html
