<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1439" rel="nofollow">http://projects.scipy.org/numpy/ticket/1439</a> on 2010-03-27 by @zachrahan, assigned to unknown.</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy
a = numpy.array([[1,2],[3,4]], order='F')
print a
l = list(a.flat)
print a
f = numpy.fromiter(a.flat, a.dtype)
print a
a2 = numpy.array(a.flat)
print a"><pre class="notranslate"><code class="notranslate">import numpy
a = numpy.array([[1,2],[3,4]], order='F')
print a
l = list(a.flat)
print a
f = numpy.fromiter(a.flat, a.dtype)
print a
a2 = numpy.array(a.flat)
print a
</code></pre></div>
<p dir="auto">yields:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="array([[1, 2],
       [3, 4]])

array([[1, 2],
       [3, 4]])

array([[1, 2],
       [3, 4]])

array([[1, 3],
       [2, 4]])"><pre class="notranslate"><code class="notranslate">array([[1, 2],
       [3, 4]])

array([[1, 2],
       [3, 4]])

array([[1, 2],
       [3, 4]])

array([[1, 3],
       [2, 4]])
</code></pre></div>
<p dir="auto">If 'a' is C-contiguous, this doesn't happen; likewise no problem (I think) if 'a' is a F-contiguous view on another array.</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/819" rel="nofollow">http://projects.scipy.org/numpy/ticket/819</a> on 2008-06-13 by trac user ahaldane, assigned to unknown.</em></p>
<p dir="auto">Hi,</p>
<p dir="auto">I get an unexpected effect from doing .flat on arrays created by c_. In the code below, the values in the variable 'b' seem to get re-ordered during the call to array. Using .flatten() instead works as expected.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from numpy import c_, array
from numpy.random import rand

b = c_[ rand(2,2), rand(2)]

print b
array(b.flat)
print b "><pre class="notranslate"><code class="notranslate">from numpy import c_, array
from numpy.random import rand

b = c_[ rand(2,2), rand(2)]

print b
array(b.flat)
print b 
</code></pre></div>
<p dir="auto">This prints:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[[ 0.8606752   0.11848512  0.95805826]
 [ 0.84665539  0.7989498   0.20762479]]
[[ 0.8606752   0.95805826  0.7989498 ]
 [ 0.11848512  0.84665539  0.20762479]] "><pre class="notranslate"><code class="notranslate">[[ 0.8606752   0.11848512  0.95805826]
 [ 0.84665539  0.7989498   0.20762479]]
[[ 0.8606752   0.95805826  0.7989498 ]
 [ 0.11848512  0.84665539  0.20762479]] 
</code></pre></div>