• Register
0 votes
3.3k 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"
6 5 3
6,930 points

Please log in or register to answer this question.

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.

9 7 4
38,600 points

Related questions

0 votes
1 answer 3 views
3 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"
asked 2 days ago Wafa Abu Yousef 2.3k points
0 votes
1 answer 3 views
3 views
Problem: HELP! I need help understanding this error: Can not merge dataframe with instance of type <class 'pandas.core.series.series'>.
asked 2 days ago Wafa Abu Yousef 2.3k points
0 votes
1 answer 2.7K views
2.7K views
Problem : I have the two DataFrames which I would want to merge. I have referred many documents and also tried to perform many operations but I am not sure what to do now. Please find my two DataFrames as below: DataFrame1: id name type currency 0 BTTA.S Apple ... here I met with the exception as below : ValueError: can not merge DataFrame with instance of type <class 'pandas.core.series.Series'>
asked Dec 24, 2019 alecxe 7.5k points
0 votes
1 answer 503 views
503 views
Here's what I've got. I have two data frames. One is a set of financial data that already exists in the system and another set that has some that may or may not exist in the system. I need to find the difference and add the ... pandas\core\frame.py", line 3571, in _compare_frame raise ValueError('Can only compare identically-labeled ' ValueError: Can only compare identically-labeled DataFrame
asked Oct 28, 2020 psandprop 2.4k points
0 votes
1 answer 31 views
31 views
Problem: dataframe' objects are mutable, thus they cannot be hashed.
asked Feb 16 charles mathews 3.9k points
0 votes
1 answer 97 views
97 views
Problem: valueerror: must have equal len keys and value when setting with an iterable
asked Feb 9 charles mathews 3.9k points
0 votes
1 answer 11 views
11 views
Interesting thing i am looking for how to add column to pandas dataframe?
asked Jan 24 waji 1.9k points
0 votes
1 answer 25 views
25 views
Problem: I have the following indexed DataFrame with named columns and strings that are not contiguous numbers: a b c d 2 0.671399 0.101208 -0.181532 0.241273 3 0.446172 -0.243316 0.051767 1.577318 5 0.614758 0.075793 -0.451460 -0.012493 I would like to ... different versions join, append, mergebut I did not get the desired result, most only errors. How do I add a column eto the above example?
asked Dec 23, 2020 sasha 13.2k points
0 votes
1 answer 38 views
38 views asked Oct 30, 2020 john 580 points