I have a data set (Data Set 1) of 3425 lines long, it has approximately 600 "Part Numbers" that are unique. Data Set 2 has a list of all of these part numbers, and more (as some aren't present in data set 1), with some corresponding run-time data. These do not repeat.
No matter what method I choose, I cannot get it to not duplicate in some way. All I want it to do, is look at line 1 in Data Set 1, and find the 3 columns of data in Data Set 2, and add it as 3 more columns to the right.
For example (This is a very basic idea)
Data Set 1:
Part Number Quantity Person
aaa 1 JK
bbb 2 PM
ccc 1 BJ
ddd 3 LL
aaa 999 ZZ
Data Set 2:
Part Number Typical Material Cats/Dogs
aaa Nylon Cat
bbb Cheese Dog
ccc Titanium Cat
ddd Cardboard Dog
eee Mouse Cat
Result:
Part Number Quantity Person Typical Material Cats/Dogs
aaa 1 JK Nylon Cat
bbb 2 PM Cheese Dog
ccc 1 BJ Titanium Cat
ddd 3 LL Cardboard Dog
aaa 999 ZZ Nylon Cat
So it can completely ignore eee as it was not required in Data Set 1, and appends the data for what I have.
I have tried numerous things to get it to work, and more that aren't below as they've been deleted. All variations of merge and concat, as well as update() and some others I've forgotten. I've tried some loops, and searched stack overflow, google, etc. All have similar ideas, but nothing actually works.
pulsesCSV = pd.read_csv("C:\location")
#pulsesCSV.set_index('Part Number') - Used for
rawDataCSV = pd.read_csv("C:\location")
#rawDataCSV.set_index('Part Number')
#df = rawDataCSV.merge(pulsesCSV, on='Part Number')
#df = pd.DataFrame(df[df.index_x==df.index_y]['Part Number'], columns=['Part Number']).reset_index(drop=True)
# Join the tables on the part number
#jointTable = pd.merge(pulsesCSV,rawDataCSV,on='Part Number')
#jointTable = pd.merge(rawDataCSV,pulsesCSV,on='Part Number',how='outer')
#jointTable = pd.concat([pulsesCSV,rawDataCSV],axis=1,join='inner')
#jointTable = rawDataCSV.combine_first(pulsesCSV)
#jointTable = pulsesCSV.combine_first(rawDataCSV)
#jointTable = rawDataCSV.join(pulsesCSV,on='Part Number',how='inner')
#export_csv = jointTable.to_csv(r"")