0

I have two DataFrames like below:

most_common_OMT = data["Order Method Type"].value_counts().sort_values(ascending=False).to_frame()
most_common_OMT

enter image description here

profitability_OMT = data.groupby("Order Method Type").agg({"Total Revenue":"mean"}).round(2).sort_values(by="Total Revenue",ascending=False)
profitability_OMT

enter image description here

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.

enter image description here

1 Answer 1

1

Let us just do

out = pd.concat([most_common_OMT, profitability_OMT], axis=1)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.