I have 2 data sets that I need to join via the asset id. I have columns in each table that can be used for the join but the excel docs are from different systems and therefore the formats are different.
My problem is dataset one will remove the zeros at the front of the dataset (see table below). These both relate to the same asset it's just the output from one system that removes the zeros at the front of the ID.
Asset | dataset 1 | dataset 2 |
---|---|---|
A | 012345 | 12345 |
B | 001235 | 1235 |
C | 0891011 | 891011 |
I am currently creating a new column that removes the front values of the ID if they are "0" to match the datasets then doing the join by using lstrip().
I am wondering if there is a more efficient way of doing this within the join function.
Edit/Answer: It appears the way I have been doing it is the most efficient thanks for your help.