Programmers learn & share
0 votes
1.1k views

Problem :

I have a big dataframe and I am trying to split that and after concat that but facing following error 
first argument must be an iterable of pandas objects, you passed an object of type "dataframe"
by (6.9k points)   | 1.1k views

1 Answer

0 votes

Solution :

I found soution for you as follows:

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)

Please note here you need to append each chunk to a list and after that you need to use concat to concatenate them all, also the ignore_index is not necessary.

by (36.1k points)  
2,227 questions
2,734 answers
59 comments
241 users