cast numpy array into memmap
<p>I generate some data in my memory and I want to cast it into numpy.memmap to save up RAM. What should I do? my data is in:</p>

<pre><code>    X_list_total_standardized=np.array(X_list_total_standardized)
</code></pre>

<p>I know that I could initialize an empty numpy.memmap:</p>

<pre><code>X_list_total_standardized_memmap=np.memmap(self._prepared_data_location_npmemmap_X,dtype='float32',mode='w+')
</code></pre>

<p>What is the most convenient way to store X_list_total_standardized into the memmap? Thank you</p>

<p>PS: would the following command be ok?</p>

<pre><code>    X_list_total_standardized_memmap[:]=X_list_total_standardized[:]
</code></pre>

<p>I found next example in numpy documentation :</p>

<pre><code>data = np.arange(12, dtype='float32')
data.resize((3,4))
fp = np.memmap(filename, dtype='float32', mode='w+', shape=(3,4))
fp[:] = data[:]
</code></pre>

<p>So your last command is ok.</p>

python arrays numpy numpy-memmap