How to process Python Pandas data frames in batches?
<p>I have three very long lists of Pandas data frames. For example:</p>

<pre><code>list_a = [tablea1, tablea2, tablea3, tablea4]

list_b = [tableb1, tableb2, tableb3, tableb4]

list_c = [tablec1, tablec2, tablec3, tablec4]
</code></pre>

<p>I want to do something like this:</p>

<pre><code>tablea1 = pd.concat([tablea1, tableb1, tablec1], axis=1)
</code></pre>

<p>So naively, I wrote such codes:</p>

<pre><code>for i in range(len(list_a)):

    list_a[i] = pd.concat([list_a[i], list_b[i], list_c[i]], axis=1)
</code></pre>

<p>This code failed to work, b/c list_a[0] is a reference to tablea1 initially, then inside the loop, list_a[0] will be re-assigned to point to </p>

<pre><code>pd.concat([tablea1, tableb1, tablec1], axis=1), 
</code></pre>

<p>which is a new object. In the end, tablea1 is not modified. (list_a does contain the desired result. But I do want to modify tablea1.) I have spent hours on this and cannot find out a solution. Any help? Thanks.</p>