'Empty Dataframe after appening

I have the following code :

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)

That returns : error_code

I don't know why, i checked the copy() function worked and there's values in df,dff,dfff.

Thanks in advance, Alexandre



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source