Reputation: 2342
I have two DataFrames like below:
most_common_OMT = data["Order Method Type"].value_counts().sort_values(ascending=False).to_frame()
most_common_OMT
profitability_OMT = data.groupby("Order Method Type").agg({"Total Revenue":"mean"}).round(2).sort_values(by="Total Revenue",ascending=False)
profitability_OMT
And how can I combine these two tables so as to acheive DataFrame like below. It is not important what will be the index, simply I need to have table something like below.
Upvotes: 0
Views: 80
Reputation: 323226
Let us just do
out = pd.concat([most_common_OMT, profitability_OMT], axis=1)
Upvotes: 1