How do I organise a nested list representing coordinate-values to a coordinate-list
<p>I would like to change my data-structure that get from my data-files in such a way that I get a list of all coordinate-values for every coordinates (so a list for all coordinates filled with values)</p>

<p>e.g.
for i in range (files):</p>

<h3>open file</h3>

<pre><code>file_output = [[0,4,6],[9,4,1],[2,5,3]]
</code></pre>

<h3>second loop</h3>

<pre><code>file_output = [[6,1,8],[4,7,3],[3,7,0]]
</code></pre>

<p>to </p>

<pre><code>coordinates = [[0,6],[4,1],[6,8],[9,4],[4,7],[1,3],[2,3],[5,7],[3,0]]
</code></pre>

<p>It should be noted that I use over 1000 files of this format, which I should merge.</p>

<p>You could also explore the built-in <strong><a href="https://docs.python.org/2/library/functions.html#zip" rel="nofollow"><code>zip()</code></a></strong> function</p>

<pre><code>&gt;&gt;&gt; l = []
&gt;&gt;&gt; for k,v in zip(a,b):
        l.append(zip(k,v))
&gt;&gt;&gt; print l
[[0,6],[4,1],[6,8],[9,4],[4,7],[1,3],[2,3],[5,7],[3,0]]
</code></pre>

python list structure coordinates