You can horizontally concatenate two dataframes in pandas using the concat
function with the axis=1
parameter.
Here's an example:
main.py505 chars16 lines
This will give you the following output:
main.py170 chars6 lines
Here, df1
and df2
are concatenated horizontally, i.e. the columns of df1
and df2
are combined to form a new dataframe concatenated_df
.
gistlibby LogSnag