Feb-28-2022, 12:15 PM
(This post was last modified: Mar-01-2022, 07:41 AM by ju21878436312.)
Can someone tell me, why the first example of how to use pd.append() works, and the second not?
# 1) This works fine: df1 = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB')) df2 = pd.DataFrame([[5, 6], [7, 8]], columns=list('AB')) df1.append(df2) df1 # 2) However this does not work: d3 = {'1':[100],'pos':["middle"]} d4 = {'1':[200],'pos':["middle"]} df3 = pd.DataFrame(data=d3) df4 = pd.DataFrame(data=d4) df3.append(df4) df3I am using the 2nd way to create my dataframe, and prefer to combine my dataframes with
pd.append()instead of
pd.concat()