<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Dear All</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">I'm a like matlab user (more specifically a Scilab one) for years, and because I've to deal with huge ascii files (with dozens of millions of lines), I decided to have a look to Python and Numpy, including vectorization topics.</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Obviously I've been influenced by my current feedbacks.</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">I've a basic question concerning the current code: why it is necessary to transpose the column vector (still in the right format in my mind)? does it make sens?</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Thanks</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Paul</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">####################################</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">import numpy as np ## np = raccourci <br /><br />## works with a row vector<br />vect0 = np.random.rand(5); print vect0; print("\n")<br />mat = np.zeros((5,4),dtype=float)<br />mat[:,0]=np.transpose(vect0); print mat<br /><br />## works while the vector is still in column i.e. in a right format, isn't it?<br />vect0 = np.random.rand(5,1); print vect0; print("\n")<br />mat = np.zeros((5,4),dtype=float)<br />mat[:,0]=np.transpose(vect0); print mat<br /><br />## does not work<br />vect0 = np.random.rand(5,1); print vect0; print("\n")<br />mat = np.zeros((5,4),dtype=float)<br />mat[:,0]=np(vect0); print mat</div>
</body></html>