<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">Using RegularGridInterpolator on a read-only 2D array with dtype numpy.float64 raises <code class="notranslate">ValueError: buffer source is read-only</code>. Of course, read-write access shouldn't be required to interpolate.</p>
<p dir="auto">It works for 2D arrays with dtype numpy.int64. Code/output is not shown, but it works both for int64 and float64 in the 3D case.</p>
<p dir="auto">The numpy array is made read-only using the <code class="notranslate">writeable</code> flag from ndarray.flags. From <a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flags.html" rel="nofollow">the numpy docs</a>:</p>
<blockquote>
<p dir="auto">Only the WRITEBACKIFCOPY, WRITEABLE, and ALIGNED flags can be changed by the user, via direct assignment to the attribute or dictionary entry, or by calling <a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.setflags.html#numpy.ndarray.setflags" rel="nofollow">ndarray.setflags</a>.</p>
</blockquote>
<blockquote>
<p dir="auto">WRITEABLE (W)<br>
The data area can be written to. Setting this to False locks the data, making it read-only. A view (slice, etc.) inherits WRITEABLE from its base array at creation time, but a view of a writeable array may be subsequently locked while the base array remains writeable. (The opposite is not true, in that a view of a locked array may not be made writeable. However, currently, locking a base object does not lock any views that already reference it, so under that circumstance it is possible to alter the contents of a locked array via a previously created writeable view onto it.) Attempting to change a non-writeable array raises a RuntimeError exception.</p>
</blockquote>
<p dir="auto">This may be related to the new fast path in v1.10.0 for 2D interpolation in RegularGridInterpolator  (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1422329991" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/17291" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/17291/hovercard" href="https://github.com/scipy/scipy/pull/17291">#17291</a>), although I don't understand how.</p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy
import scipy.interpolate

a = numpy.array(
    [
        [0, 0, 0, 0, 0],
        [0, 1, 1, 1, 0],
        [0, 1, 1, 1, 0],
        [0, 1, 1, 1, 0],
        [0, 0, 0, 0, 0],
    ]
)

z = numpy.copy(a)
z.flags.writeable = False
print(z.dtype)
print(z)
interpolator = scipy.interpolate.RegularGridInterpolator(
    (numpy.linspace(0, 5, num=5), numpy.linspace(0, 5, num=5)),
    z,
    method=&quot;linear&quot;,
)

print(&quot;Interpolation on read-only int array:&quot;, interpolator([0.5, 0.5]), &quot;: OK.&quot;)
print()

z = numpy.copy(a)
z = z.astype(float, casting=&quot;safe&quot;)
z.flags.writeable = False
print(z.dtype)
print(z)

interpolator = scipy.interpolate.RegularGridInterpolator(
    (numpy.linspace(0, 5, num=5), numpy.linspace(0, 5, num=5)),
    z,
    method=&quot;linear&quot;,
)

print(&quot;Interpolation on read-only float array:&quot;, interpolator([0.5, 0.5]), &quot;: crashes.&quot;)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span>
<span class="pl-k">import</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span>

<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">array</span>(
    [
        [<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>],
        [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>],
        [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>],
        [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>],
        [<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>],
    ]
)

<span class="pl-s1">z</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">copy</span>(<span class="pl-s1">a</span>)
<span class="pl-s1">z</span>.<span class="pl-s1">flags</span>.<span class="pl-s1">writeable</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span>
<span class="pl-en">print</span>(<span class="pl-s1">z</span>.<span class="pl-s1">dtype</span>)
<span class="pl-en">print</span>(<span class="pl-s1">z</span>)
<span class="pl-s1">interpolator</span> <span class="pl-c1">=</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span>.<span class="pl-v">RegularGridInterpolator</span>(
    (<span class="pl-s1">numpy</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-s1">num</span><span class="pl-c1">=</span><span class="pl-c1">5</span>), <span class="pl-s1">numpy</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-s1">num</span><span class="pl-c1">=</span><span class="pl-c1">5</span>)),
    <span class="pl-s1">z</span>,
    <span class="pl-s1">method</span><span class="pl-c1">=</span><span class="pl-s">"linear"</span>,
)

<span class="pl-en">print</span>(<span class="pl-s">"Interpolation on read-only int array:"</span>, <span class="pl-en">interpolator</span>([<span class="pl-c1">0.5</span>, <span class="pl-c1">0.5</span>]), <span class="pl-s">": OK."</span>)
<span class="pl-en">print</span>()

<span class="pl-s1">z</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">copy</span>(<span class="pl-s1">a</span>)
<span class="pl-s1">z</span> <span class="pl-c1">=</span> <span class="pl-s1">z</span>.<span class="pl-en">astype</span>(<span class="pl-s1">float</span>, <span class="pl-s1">casting</span><span class="pl-c1">=</span><span class="pl-s">"safe"</span>)
<span class="pl-s1">z</span>.<span class="pl-s1">flags</span>.<span class="pl-s1">writeable</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span>
<span class="pl-en">print</span>(<span class="pl-s1">z</span>.<span class="pl-s1">dtype</span>)
<span class="pl-en">print</span>(<span class="pl-s1">z</span>)

<span class="pl-s1">interpolator</span> <span class="pl-c1">=</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span>.<span class="pl-v">RegularGridInterpolator</span>(
    (<span class="pl-s1">numpy</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-s1">num</span><span class="pl-c1">=</span><span class="pl-c1">5</span>), <span class="pl-s1">numpy</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-s1">num</span><span class="pl-c1">=</span><span class="pl-c1">5</span>)),
    <span class="pl-s1">z</span>,
    <span class="pl-s1">method</span><span class="pl-c1">=</span><span class="pl-s">"linear"</span>,
)

<span class="pl-en">print</span>(<span class="pl-s">"Interpolation on read-only float array:"</span>, <span class="pl-en">interpolator</span>([<span class="pl-c1">0.5</span>, <span class="pl-c1">0.5</span>]), <span class="pl-s">": crashes."</span>)</pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="dtype: int64
[[0 0 0 0 0]
 [0 1 1 1 0]
 [0 1 1 1 0]
 [0 1 1 1 0]
 [0 0 0 0 0]]
Interpolation on read-only int array: [0.16] : OK.

dtype: float64
[[0. 0. 0. 0. 0.]
 [0. 1. 1. 1. 0.]
 [0. 1. 1. 1. 0.]
 [0. 1. 1. 1. 0.]
 [0. 0. 0. 0. 0.]]
Traceback (most recent call last):
  File &quot;/home/vleduc/python/newdev/rtdata/_test_bug_scipy.py&quot;, line 39, in &lt;module&gt;
    print(&quot;Interpolation on read-only float array:&quot;, interpolator([0.5, 0.5]), &quot;: crashes.&quot;)
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/home/vleduc/python/venvs/rtdata-py311/lib/python3.11/site-packages/scipy/interpolate/_rgi.py&quot;, line 336, in __call__
    result = evaluate_linear_2d(self.values,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;_rgi_cython.pyx&quot;, line 19, in scipy.interpolate._rgi_cython.evaluate_linear_2d
  File &quot;stringsource&quot;, line 660, in View.MemoryView.memoryview_cwrapper
  File &quot;stringsource&quot;, line 350, in View.MemoryView.memoryview.__cinit__
ValueError: buffer source array is read-only"><pre class="notranslate">dtype: int64
[[0 0 0 0 0]
 [0 1 1 1 0]
 [0 1 1 1 0]
 [0 1 1 1 0]
 [0 0 0 0 0]]
Interpolation on read-only int array: [0.16] <span class="pl-c1">:</span> OK.

dtype: float64
[[0. 0. 0. 0. 0.]
 [0. 1. 1. 1. 0.]
 [0. 1. 1. 1. 0.]
 [0. 1. 1. 1. 0.]
 [0. 0. 0. 0. 0.]]
Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>/home/vleduc/python/newdev/rtdata/_test_bug_scipy.py<span class="pl-pds">"</span></span>, line 39, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    print(<span class="pl-s"><span class="pl-pds">"</span>Interpolation on read-only float array:<span class="pl-pds">"</span></span>, interpolator([0.5, 0.5]), <span class="pl-s"><span class="pl-pds">"</span>: crashes.<span class="pl-pds">"</span></span>)
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File <span class="pl-s"><span class="pl-pds">"</span>/home/vleduc/python/venvs/rtdata-py311/lib/python3.11/site-packages/scipy/interpolate/_rgi.py<span class="pl-pds">"</span></span>, line 336, <span class="pl-k">in</span> __call__
    result = evaluate_linear_2d(self.values,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File <span class="pl-s"><span class="pl-pds">"</span>_rgi_cython.pyx<span class="pl-pds">"</span></span>, line 19, <span class="pl-k">in</span> scipy.interpolate._rgi_cython.evaluate_linear_2d
  File <span class="pl-s"><span class="pl-pds">"</span>stringsource<span class="pl-pds">"</span></span>, line 660, <span class="pl-k">in</span> View.MemoryView.memoryview_cwrapper
  File <span class="pl-s"><span class="pl-pds">"</span>stringsource<span class="pl-pds">"</span></span>, line 350, <span class="pl-k">in</span> View.MemoryView.memoryview.__cinit__
ValueError: buffer <span class="pl-c1">source</span> array is read-only</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">1.10.0 1.24.1 sys.version_info(major=3, minor=11, micro=1, releaselevel='final', serial=0)</p>
<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">Using a slightly modified version of the example from the documentation</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy
from scipy.interpolate import interpn


def value_func_3d(x, y, z):
    return 2 * x + 3 * y - z


x = numpy.linspace(0, 4, 5)
y = numpy.linspace(0, 5, 6)
z = numpy.linspace(0, 6, 7)
points = (x, y, z)
values = value_func_3d(*numpy.meshgrid(*points, indexing='ij'))
point = numpy.array([2.21, 3.12, 1.15])
print(interpn(points, values, point))
for ax in points:
    ax.flags.writeable = False
print(interpn(points, values, point))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span>
<span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span> <span class="pl-k">import</span> <span class="pl-s1">interpn</span>


<span class="pl-k">def</span> <span class="pl-en">value_func_3d</span>(<span class="pl-s1">x</span>, <span class="pl-s1">y</span>, <span class="pl-s1">z</span>):
    <span class="pl-k">return</span> <span class="pl-c1">2</span> <span class="pl-c1">*</span> <span class="pl-s1">x</span> <span class="pl-c1">+</span> <span class="pl-c1">3</span> <span class="pl-c1">*</span> <span class="pl-s1">y</span> <span class="pl-c1">-</span> <span class="pl-s1">z</span>


<span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">4</span>, <span class="pl-c1">5</span>)
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-c1">6</span>)
<span class="pl-s1">z</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">6</span>, <span class="pl-c1">7</span>)
<span class="pl-s1">points</span> <span class="pl-c1">=</span> (<span class="pl-s1">x</span>, <span class="pl-s1">y</span>, <span class="pl-s1">z</span>)
<span class="pl-s1">values</span> <span class="pl-c1">=</span> <span class="pl-en">value_func_3d</span>(<span class="pl-c1">*</span><span class="pl-s1">numpy</span>.<span class="pl-en">meshgrid</span>(<span class="pl-c1">*</span><span class="pl-s1">points</span>, <span class="pl-s1">indexing</span><span class="pl-c1">=</span><span class="pl-s">'ij'</span>))
<span class="pl-s1">point</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">array</span>([<span class="pl-c1">2.21</span>, <span class="pl-c1">3.12</span>, <span class="pl-c1">1.15</span>])
<span class="pl-en">print</span>(<span class="pl-en">interpn</span>(<span class="pl-s1">points</span>, <span class="pl-s1">values</span>, <span class="pl-s1">point</span>))
<span class="pl-k">for</span> <span class="pl-s1">ax</span> <span class="pl-c1">in</span> <span class="pl-s1">points</span>:
    <span class="pl-s1">ax</span>.<span class="pl-s1">flags</span>.<span class="pl-s1">writeable</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span>
<span class="pl-en">print</span>(<span class="pl-en">interpn</span>(<span class="pl-s1">points</span>, <span class="pl-s1">values</span>, <span class="pl-s1">point</span>))</pre></div>
<p dir="auto">Fails with</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="...
    return find_indices(self.grid, xi)
  File &quot;_rgi_cython.pyx&quot;, line 95, in scipy.interpolate._rgi_cython.find_indices
  File &quot;stringsource&quot;, line 660, in View.MemoryView.memoryview_cwrapper
  File &quot;stringsource&quot;, line 350, in View.MemoryView.memoryview.__cinit__
ValueError: buffer source array is read-only"><pre class="notranslate">...
    <span class="pl-k">return</span> find_indices(self.grid, xi)
  File <span class="pl-s"><span class="pl-pds">"</span>_rgi_cython.pyx<span class="pl-pds">"</span></span>, line 95, <span class="pl-k">in</span> scipy.interpolate._rgi_cython.find_indices
  File <span class="pl-s"><span class="pl-pds">"</span>stringsource<span class="pl-pds">"</span></span>, line 660, <span class="pl-k">in</span> View.MemoryView.memoryview_cwrapper
  File <span class="pl-s"><span class="pl-pds">"</span>stringsource<span class="pl-pds">"</span></span>, line 350, <span class="pl-k">in</span> View.MemoryView.memoryview.__cinit__
ValueError: buffer <span class="pl-c1">source</span> array is read-only</pre></div>
<p dir="auto">A more minimal example is:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy
from scipy.interpolate import _rgi


grid = (numpy.array([0, 1], dtype='f8'), )
xi = numpy.array([[0.5, 0.5], ])
grid[0].flags.writeable = False
print(_rgi.find_indices(grid, xi))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span>
<span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span> <span class="pl-k">import</span> <span class="pl-s1">_rgi</span>


<span class="pl-s1">grid</span> <span class="pl-c1">=</span> (<span class="pl-s1">numpy</span>.<span class="pl-en">array</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'f8'</span>), )
<span class="pl-s1">xi</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">array</span>([[<span class="pl-c1">0.5</span>, <span class="pl-c1">0.5</span>], ])
<span class="pl-s1">grid</span>[<span class="pl-c1">0</span>].<span class="pl-s1">flags</span>.<span class="pl-s1">writeable</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span>
<span class="pl-en">print</span>(<span class="pl-s1">_rgi</span>.<span class="pl-en">find_indices</span>(<span class="pl-s1">grid</span>, <span class="pl-s1">xi</span>))</pre></div>
<p dir="auto">This may be related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1402051768" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/17172" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/17172/hovercard" href="https://github.com/scipy/scipy/issues/17172">#17172</a> and may have been introduced with the cython code in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1422329991" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/17291" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/17291/hovercard" href="https://github.com/scipy/scipy/pull/17291">#17291</a></p>
<p dir="auto">Adding a const to this line appear to fix the problem locally: </p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/scipy/scipy/blob/7b858b70c16c5559c2155a6bf2c39b32e45fbb78/scipy/interpolate/_rgi_cython.pyx#L79">scipy/scipy/interpolate/_rgi_cython.pyx</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 79
      in
      <a data-pjax="true" class="commit-tease-sha" href="/scipy/scipy/commit/7b858b70c16c5559c2155a6bf2c39b32e45fbb78">7b858b7</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L79" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="79"></td>
          <td id="LC79" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">double</span>[::<span class="pl-c1">1</span>] grid_i </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy
from scipy.interpolate import _rgi


grid = (numpy.array([0, 1], dtype='f8'), )
xi = numpy.array([[0.5, 0.5], ])
grid[0].flags.writeable = False
print(_rgi.find_indices(grid, xi))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span>
<span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span> <span class="pl-k">import</span> <span class="pl-s1">_rgi</span>


<span class="pl-s1">grid</span> <span class="pl-c1">=</span> (<span class="pl-s1">numpy</span>.<span class="pl-en">array</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'f8'</span>), )
<span class="pl-s1">xi</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-en">array</span>([[<span class="pl-c1">0.5</span>, <span class="pl-c1">0.5</span>], ])
<span class="pl-s1">grid</span>[<span class="pl-c1">0</span>].<span class="pl-s1">flags</span>.<span class="pl-s1">writeable</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span>
<span class="pl-en">print</span>(<span class="pl-s1">_rgi</span>.<span class="pl-en">find_indices</span>(<span class="pl-s1">grid</span>, <span class="pl-s1">xi</span>))</pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="File &quot;_rgi_cython.pyx&quot;, line 95, in scipy.interpolate._rgi_cython.find_indices
  File &quot;stringsource&quot;, line 660, in View.MemoryView.memoryview_cwrapper
  File &quot;stringsource&quot;, line 350, in View.MemoryView.memoryview.__cinit__
ValueError: buffer source array is read-only"><pre class="notranslate">File <span class="pl-s"><span class="pl-pds">"</span>_rgi_cython.pyx<span class="pl-pds">"</span></span>, line 95, <span class="pl-k">in</span> scipy.interpolate._rgi_cython.find_indices
  File <span class="pl-s"><span class="pl-pds">"</span>stringsource<span class="pl-pds">"</span></span>, line 660, <span class="pl-k">in</span> View.MemoryView.memoryview_cwrapper
  File <span class="pl-s"><span class="pl-pds">"</span>stringsource<span class="pl-pds">"</span></span>, line 350, <span class="pl-k">in</span> View.MemoryView.memoryview.__cinit__
ValueError: buffer <span class="pl-c1">source</span> array is read-only</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">1.11.0.dev0+0.057cf5c 1.24.1 sys.version_info(major=3, minor=10, micro=6, releaselevel='final', serial=0)</p>