Add row at the bottom with the total
(features, profile)
| 49 | |
| 50 | |
| 51 | def totalData(features, profile): |
| 52 | """Add row at the bottom with the total""" |
| 53 | |
| 54 | accumulator = {} |
| 55 | for f in features: |
| 56 | accumulator[f] = 0 |
| 57 | accumulator["name"] = "total" |
| 58 | |
| 59 | for row in profile: |
| 60 | for f in features: |
| 61 | if f in row and not f == "name": |
| 62 | accumulator[f] += row[f] |
| 63 | |
| 64 | return accumulator |
| 65 | |
| 66 | |
| 67 | def findAndRemove(profile, name): |