title: How to add a scalar to a numpy array within a specific range?
body: <p>Is there a simpler and more memory efficient way to do the following in numpy alone.  </p>
  
  <pre class="lang-python prettyprint-override"><code>import numpy as np
  ar = np.array(a[l:r])
  ar += c
  a = a[0:l] + ar.tolist() + a[r:]
  </code></pre>
  
  <p>It may look primitive but it involves obtaining a subarray copy of the given array, then prepare two more copies of the same to append in left and right direction in addition to the scalar add. I was hoping to find some more optimized way of doing this. I would like a solution that is completely in Python list or NumPy array, but not both as converting from one form to another as shown above would cause serious overhead when the data is huge.</p>