I have two tables: sales table & product table and these two tables share the 'PART NUMBER' column.
The 'PART NUMBER' column in the sales table is not unique, but it is unique in the product table. (see image below of a snapshot of the sales table & product table)
I was trying to add the equivalent 'Description' to each 'PART NUMBER' on the sales table, and I followed the examples from the pandas website
my code
sales.join(part_table, on='PART NUMBER')
But I got this error:
ValueError: columns overlap but no suffix specified: Index([u'PART NUMBER'], dtype='object')
Can someone explain what this error means and how to solve it?
Many thanks!
Best Answer
I think you want to do a merge rather than a join:
Here's an example dataframe:
It's unclear from the docs if this is intentational (I thought that
on
would be used as the column) but following the exceptions message if you add suffixs we can see what's going on:It's ignoring the on kwarg and just doing the join.