Setting train array dimensions for face recognition for python : <p>I'm trying to find an equivalent code for python to set the following dimensions that I set in R:</p>

<pre><code>dim(train_array) = c(28, 28, 1, ncol(train_x))
</code></pre>

<p>train_x is a matrix of 28 by 28 resized (grey scale) olivetti face images digitized into 784 (28 * 28) pixel rows (each row is labeled pixel.1, pixel.2, and so on) and 15 columns.  Is there any python package that does the same function as dim() for R in python?</p>
