Premium problem106. Housing Units Completed per Year

Easy Locked

housing has columns year, month and one column per region: south, west, midwest, northeast.

Return a Series indexed by year giving the total units completed across all four regions in that year, sorted by year.

Input

   year  month  south  west  midwest  northeast
0  2020      1     10     1        5          0
1  2020      2     20     2        5          1
2  2021      1     30     3        5          2

Output

year
2020    44
2021    40
dtype: int64

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)