Unfortunately, the source files are no longer available, so I can not verify my solution in your case. In my case, an error occurred when:
- Data frames have two columns with the same name (I had columns
ID and ID , which were then converted to lowercase, so they become the same) - The types of column values ββwith the same name differ
Here is an example that gives me an error:
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
Deleting / renaming one of the columns makes this code work.
Karatheodory
source share