Skip to content
Advertisement

Derive consumption from existing column (Pandas)

Data

JavaScript

Desired

JavaScript

Doing

JavaScript

first create derived column

JavaScript

Any suggestion is helpful

Advertisement

Answer

You aren’t using a correct aggregation function. You should be using sum on both your “used” and “total” columns:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement