Answers for "append a df to another df"

1

append dataframe to another dataframe

>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'), index=['x', 'y'])
>>> df
   A  B
x  1  2
y  3  4
>>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=list('AB'), index=['x', 'y'])
>>> df.append(df2, ignore_index=True)
   A  B
x  1  2
y  3  4
x  5  6
y  7  8
Posted by: Guest on July-03-2021
8

append one row to pandas dataframe

df = df.append({'index1': value1, 'index2':value2,...}, ignore_index=True)
Posted by: Guest on May-04-2020
0

how to append a dataframe to another dataframe in pandas

# all_res is list of DataFrames : [ dataframe, dataframe, ... ]
df_res = pd.concat(all_res)
Posted by: Guest on December-21-2020
2

appending dataframes pandas

>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'))
>>> df
   A  B
0  1  2
1  3  4
>>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=list('AB'))
>>> df.append(df2)
   A  B
0  1  2
1  3  4
0  5  6
1  7  8
Posted by: Guest on June-10-2020

Python Answers by Framework

Browse Popular Code Answers by Language