I am trying to concat dataframes based on the foll. 2 csv files:
df_a: https://www.dropbox.com/s/slcu7o7yyottujl/df_current.csv?dl=0
df_b: https://www.dropbo
Unfortunately, the source files are already unavailable, so I can't check my solution in your case. In my case the error occurred when:
ID
and id
columns, which I then converted to lower case, so they become the same)Here is an example which gives me the error in question:
df1 = pd.DataFrame(data=[
['a', 'b', 'id', 1],
['a', 'b', 'id', 2]
], columns=['A', 'B', 'id', 'id'])
df2 = pd.DataFrame(data=[
['b', 'c', 'id', 1],
['b', 'c', 'id', 2]
], columns=['B', 'C', 'id', 'id'])
pd.concat([df1, df2])
>>> AssertionError: Number of manager items must equal union of block items
# manager items: 4, # tot_items: 5
Removing / renaming one of the columns makes this code work.