TypeError: first argument must be an iterable of pandas objects, you passed an object of type "DataFrame"
<p>I have a big dataframe and I try to split that and after <code>concat</code> that.
I use</p>

<pre><code>df2 = pd.read_csv('et_users.csv', header=None, names=names2, chunksize=100000)
for chunk in df2:
    chunk['ID'] = chunk.ID.map(rep.set_index('member_id')['panel_mm_id'])

df2 = pd.concat(chunk, ignore_index=True)
</code></pre>

<p>But it return an error</p>

<pre><code>TypeError: first argument must be an iterable of pandas objects, you passed an object of type "DataFrame"
</code></pre>

<p>How can I fix that?</p>

<p>IIUC you want the following:</p>

<pre><code>df2 = pd.read_csv('et_users.csv', header=None, names=names2, chunksize=100000)
chunks=[]
for chunk in df2:
    chunk['ID'] = chunk.ID.map(rep.set_index('member_id')['panel_mm_id'])
    chunks.append(chunk)

df2 = pd.concat(chunks, ignore_index=True)
</code></pre>

<p>You need to append each chunk to a list and then use <code>concat</code> to concatenate them all, also I think the <code>ignore_index</code> may not be necessary but I may be wrong</p>

python pandas