Skip to content
Advertisement

Output sum rounded to the nearest even number using Python

I wish to take the sum of each row and round this value to the closest even number.

Data

JavaScript

Desired

JavaScript

Doing

JavaScript

I realize I have to incorporate i+i.mod(2) into this script, however I am not sure how to incorporate. Any suggestion is helpful.

Advertisement

Answer

here is one way to do it

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