Array Map And Reduce In Python