Reading establishment ID from RAIS: variable id_estab - jamiefogel/Networks GitHub Wiki

The issue is that the variable id_estab is sometimes stored as a string, sometimes numeric and when it's a string sometimes it's padded with leading zeros, sometimes not. Inconsistencies in format will cause the code to fail, while inconsistencies with leading zeros will cause the merge to be incomplete.

Jamie's solution: I am trying to edit our code to do the following when we load new raw data:

df['id_estab'] = df['id_estab'].astype(str).str.zfill(14)

This will convert it to string and ensure that it is left-padded with zeros so that it has a length of 14.