How to add specific value to all numpy array elements in Python

1 Answer

0 votes
import numpy as np 
      
arr = np.array([1, 2, 3, 4]) 
   
arr = arr.__add__(3) 

print(arr)
  
     
    
'''
run:
  
[4 5 6 7]
    
'''

 



answered Feb 25, 2020 by avibootz

Related questions

...