The problem is different from the dtypescolumn CommitID.
Need to check them out:
print (files['CommitID'].dtypes)
print (commits['CommitID'].dtypes)
And then convert astypeto the same:
#change only object
files['CommitID'] = files['CommitID'].astype(int)
commits['CommitID'] = commits['CommitID'].astype(int)
files['CommitID'] = files['CommitID'].astype(str)
commits['CommitID'] = commits['CommitID'].astype(str)
Jurassic code can be simplified - skip default how='innerand use only on:
df = files.merge(right=commits, on="CommitID")
print (df)
CommitID MOD COMMITTER
0 1 0 A
1 2 1 B
2 3 7 B
Or, if only the same related columns in DataFrames:
df = files.merge(right=commits)
print (df)
CommitID MOD COMMITTER
0 1 0 A
1 2 1 B
2 3 7 B
source
share