Reputation: 21
So, by using pandas.concat with axis=1 I got the following dataframe:
'A' | 'B' | 'C' | 'D' | 'E' | 'A' | 'B' | 'C' | 'D' | 'E' | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
But I need the data to be displayed like the folowing example:
'A' | 'B' | 'C' | 'D' | 'E' | |
---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 |
1 | 6 | 7 | 8 | 9 | 10 |
Is there a way to either transform the first dataframe I talked about in the second one, or get the second one directly with another command other than concat?
Upvotes: 1
Views: 41
Reputation: 1
you should just use df.append() function not, pd.concat().
here is a brief example.
df = pd.DataFrame(columns=['a','b'], data=[[1,2]])
df2 = pd.DataFrame(columns=['a','b'], data=[[3,4]])
df.append(df2)
Upvotes: 0