I have pyspark dataframe with 3 fields as shown below (Unique Idn, visit time, new visit), I want to create another new fields (visit seq - yellow highlighted) based on every time new visit happens (as 1) for each unique idn.
So every time there is new visit for each unique identifier, it should increment the counter. Its kind of visit number. Example for Unique Idn, 11, visit start at 1/11 6:24 and ends at 1/11 6:26 and its tagged as visit 2 starting from 1/11 6:24 till 1/11 6:26.