I have the following dataframe:
UNIQUE_IDENTIFIER COUNTRY_CODE
0 1 CZ
1 nan CZ
2 2 SK
3 4 AE
4 nan DK
5 nan CZ
6 nan DK
7 nan ES
For all blank values in the "UNIQUE_IDENTIFIER" column, I would like to create a value that takes the "COUNTRY_CODE" and add incremental numbers (with a space in between the number and the Country Code) starting from 1 for each different country code. So the final dataframe would be this:
UNIQUE_IDENTIFIER COUNTRY_CODE
0 1 CZ
1 CZ 1 CZ
2 2 SK
3 4 AE
4 DK 1 DK
5 CZ 2 CZ
6 DK 2 DK
7 ES 1 ES
What would be the best way to do it?