add 1 to all elements in array python

Solutions on MaxInterview for add 1 to all elements in array python by the best coders in the world

showing results for - "add 1 to all elements in array python"
Elisa
22 May 2018
1import numpy
2a = [1, 1, 1 ,1, 1]
3ar = numpy.array(a)
4print ar + 2
5
similar questions
queries leading to this page
add 1 to all elements in array python