I want to join data frames using pandas.
I have several data frames. For example, two of them are:
df1=
A B C
0 1 1.1 1.2 1.3
1 2 1.4 1.5 1.4
and df2=
A B C
0 1 2.1 2.2 2.3
1 2 2.4 2.5 2.4
I would like to join them into 1 data frame like:
A B C
R1 0 1 1.1 1.2 1.3
1 2 1.4 1.5 1.4
A B C
R2 0 1 2.1 2.2 2.3
1 2 2.4 2.5 2.4
I tried to put them into a dictionary and convert them to the DataFrame like:
dict_val = {}
dict_val['R1'] = df1
dict_val['R2'] = df2
df_join = pd.DataFrame.from_dict(dict_val)
however, I am getting the following error: ValueError: Must pass 2-d input.
How can I make this type of data frame?