I would like to sum two columns, each in different frame if certain criteria is met.
Dataframe 1:
desk Type total_position
desk1 ES 786.0
desk1 ES1 100
desk2 ES1 0
desk2 ES2 10
desk3 ES 0
desk4 ES1 0
desk5 ES -757
Dataframe 2:
desk Type total_position
desk1 ES -758.0
desk2 ES 0
desk3 ES -29
desk4 ES 0.0
desk5 ES 786.0
I would like to sum both the positions if only the type is "ES" in the first dataframe and it is the same desk.
How do i do that?
Expected Answer
desk Type total_position
desk1 ES 29
desk2 ES1 0
desk3 ES -29
desk4 ES1 0
desk5 ES 29