<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">+1 on the astype(int) call.
<div><br /></div>
<div>+1 also on using dask. scikit-image has a couple of functions that might be useful:</div>
<div><br /></div>
<div>- skimage.util.apply_parallel: applies a function to an input array in chunks, with user-selectable chunk size and margins. This is powered by dask.</div>
<div>- skimage.util.view_as_windows: uses stride tricks to produce a sliding window view over an n-dimensional array.</div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
On 16 Sep 2017, 8:16 AM +1000, Chris Barker - NOAA Federal <chris.barker@noaa.gov>, wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div>No thoughts on optimizing memory, but that indexing error probably comes from np.mean producing float results. An astype call shoulder that work.</div>
<div id="AppleMailSignature"><br /></div>
<div id="AppleMailSignature">-CHB<br />
<br />
Sent from my iPhone</div>
<div><br />
On Sep 15, 2017, at 5:51 PM, Robert McLeod <<a href="mailto:robbmcleod@gmail.com">robbmcleod@gmail.com</a>> wrote:<br />
<br /></div>
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div>
<div dir="ltr">
<div class="gmail_extra"><br />
<div class="gmail_quote">On Fri, Sep 15, 2017 at 2:37 PM, Elliot Hallmark <span dir="ltr"><<a href="mailto:Permafacture@gmail.com" target="_blank">Permafacture@gmail.com</a>></span> wrote:<br />
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;">
<p dir="ltr">Nope. Numpy only works on in memory arrays. You can determine your own chunking strategy using hdf5, or something like dask can figure that strategy out for you. With numpy you might worry about not accidentally making duplicates or intermediate arrays, but that's the extent of memory optimization you can do in numpy itself.</p>
</blockquote>
</div>
<br />
NumPy does have it's own memory map variant on ndarray:</div>
<div class="gmail_extra"><br /></div>
<div class="gmail_extra"><a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.memmap.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.memmap.html</a><br /></div>
<div class="gmail_extra"><br /></div>
<div class="gmail_extra"><br clear="all" />
<div><br /></div>
--<br />
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Robert McLeod, Ph.D.</div>
<div><a href="mailto:robbmcleod@gmail.com" target="_blank">robbmcleod@gmail.com</a><br /></div>
<div><a href="mailto:robbmcleod@protonmail.com" target="_blank">robbmcleod@protonmail.com</a></div>
<div><br /></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div><span>_______________________________________________</span><br />
<span>NumPy-Discussion mailing list</span><br />
<span><a href="mailto:NumPy-Discussion@python.org">NumPy-Discussion@python.org</a></span><br />
<span><a href="https://mail.python.org/mailman/listinfo/numpy-discussion">https://mail.python.org/mailman/listinfo/numpy-discussion</a></span><br /></div>
</blockquote>
</blockquote>
<div></div>
</div>
</body>
</html>