prng = np.random.RandomState(0)
df = pd.DataFrame({'company_id': prng.randint(10 ** 6, size=10 ** 7),
    'company_name': prng.rand(10 ** 7).astype('str')})
df.head()
pandas: grouping by key to cluster messy strings