#NEWLINE# def ratio_mapfunc( rep , col , row ) : #NEWLINE# #INDENT# plus = float ( ( row [ 1 ] [ 'votes' ] [ 'flag-p2' ] + row [ 1 ] [ 'votes' ] [ 'flag-p1' ] ) ) #NEWLINE# minus = float ( ( row [ 1 ] [ 'votes' ] [ 'flag-m2' ] + row [ 1 ] [ 'votes' ] [ 'flag-m1' ] ) ) #NEWLINE# ratio = ( ( plus / ( plus + plus ) ) * 100 ) #NEWLINE# return ratio