Pandas - Create a Integer Primary Key based in string columns - python I need to create a primary key based in string columns in my dataframe
Month       Name                   ID
01/01/2020  FileName1 - Example    1
01/02/2020  FileName2 - Example    2
01/03/2020  FileName3 - Example    3

I'm using the hash, but its generating the largest values, I would like that ID was the integer numbers.
This is my code
all_data['unique_id'] = all_data._ID.map(hash)

where  _ID is :
all_data['_ID'] = all_data['Month'].astype(str) + all_data['Name']

This group by return 0 for all rows
all_data['sequence']=all_data.groupby('_ID').cumcount()
You could simply drop the index to create and use it as a primary key column.
all_data.reset_index(inplace=True)
all_data.head()