My dataset consists out of two columns, PersonID and Request for application(Aanvraag datum). Some PersonIDs occur multiple times because these persons received multiple request on different dates:
Now I want to create multiple request columns per PersonID. For example if a PersonID occurs three times, then the code creates three columns for three different requests dates. If a PersonID occurs one time, the code assigns NaN to the empty requests. In the end there will be as many columns as the PersonID with the most requests.
Many thanks!