Python ValueError if running on different laptop
my guess (a wild guess) is that the data from the 2 tab-separated CSV files (i.e., TSV files) is somehow converted using different locales on your computer and your colleague's computer.
Check if you have locale-dependent operations that could cause a number with the "wrong" decimal separator not to be recognized as a number.
This should not happen in pd.read_csv() because the decimal parameter has a well-defined default value of ".".
But from an experience I had with timestamps in another context, one timestamp with a "bad" format can cause the whole column to be of the wrong type. So if just one number of just one of the two files, in the column you are merging on, has a decimal separator, and this decimal separator is only recognized as such on your machine, only on your machine the join will succeed (I'm supposing that pandas can join numeric columns even if they are of different type).
I've just built a function that is working fine on my laptop (Mac, but I'm working on a Windows virtual machine of the office laptop), but when I pass it to a colleague o'mine, it raises a ValueError:
"You are trying to merge on object and int64 columns. If you wish to proceed you should use pd.concat"
The line of the code that raises the error is a simple merge that on my laptop works perfectly:
df = pd.merge(df1, df2, on = "x", how = "outer)
The input files are exactly the same (taken directly from the same remote folder).
I totally don't know how to fix the problem, and I don't understand why on my laptop it works (even if I open a new script or I restart the kernel, so no stored variables around) and in the one of my colleague it doesn't.
Thanks for your help!