1

Here is the example:

Sample data frame 1:

Sample data frame 1

Sample data frame 2:

Sample data frame 2

The output data frame should be something like this:

The output data frame

Max() of similar terms should be considered if the row - column value is repeating in data frames.

Can anyone help me with this?

1
  • Images dont help with reproducing your code. Please add code snippets instead. Commented Feb 12, 2021 at 10:54

2 Answers 2

1

Thankyou for the Help @Vignesh

pd.concat([df_A, df_B], axis=0).fillna(0).groupby('col').max() gives the required result

Sign up to request clarification or add additional context in comments.

Comments

0

I think you can use pd.concat for this.

You could refer this pandas doc https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.