• Register
0 votes
4.4k 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.9k 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.

38.6k points

Related questions

0 votes
1 answer 209 views
209 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 Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 3.6k views
3.6k 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
0 answers 2 views
2 views
Problem: Get first n rows of dataframe pandas .
asked 23 hours ago Diederich Raf 120k points
0 votes
1 answer 36 views
36 views
Problem: I'm hoping for some assistance : Can not merge dataframe with instance of type <class 'pandas.core.series.series'>
asked Jun 14 asha 121k points
0 votes
1 answer 66 views
66 views
Problem: HELP! I need help understanding this error: Can not merge dataframe with instance of type <class 'pandas.core.series.series'>.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 4.1k views
4.1k 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 11 views
11 views
Problem: Argument of type 'float' is not iterable.
asked Jul 19 akhi 125k points
0 votes
0 answers 17 views
17 views
I am trying this code: Here I have merge two data frame then apply one condition to find some specific row where columns A=0 and B=0.then want to save a value in a new data frame column. individualSNPs = pd.concat((SNPdataframe, genotypeDataFrame), ... packages/pandas/core/generic.py", line 1668, in __hash__ raise TypeError( TypeError: 'DataFrame' objects are mutable, thus they cannot be hashed
asked May 19 shahedulIslam 120 points
0 votes
1 answer 47 views
47 views
Problem: Pandas a value is trying to be set on a copy of a slice from a dataframe.
asked May 6 Ryan evans 1.6k points
0 votes
1 answer 245 views
245 views
Problem: dataframe' objects are mutable, thus they cannot be hashed.
asked Feb 16 charles mathews 5.5k points