I'm working with pandas. I have an existing column with accumulated days starting in the second day, ex -> [2, 3, 4, 5, 6, 7, 8, 9, 10, ..]
. I'm trying to create a new Dataframe with the count of the week. I want to use lambda for this but I'm not able to figure out how to do this.
The code looks like this
day_counter = 1
week = 1
df_eqpt['WeekNumber'] = df_eqpt['day'].apply(lambda x: week + 1 if day_counter == day_counter + 7 else day_counter += 1)
Any suggestions of how to go about this are much appreciated :)