I have a dataframe df
that looks similar to this:
identity Start End week
E 6/18/2020 7/2/2020 1
E 6/18/2020 7/2/2020 2
2D 7/18/2020 8/1/2020 1
2D 7/18/2020 8/1/2020 2
A1 9/6/2020 9/20/2020 1
A1 9/6/2020 9/20/2020 2
The problem is that when I extracted the data I only had Start date and End date for every identity it replaced, but I have the data by weeks all identitys have the same amount of weeks some times all identitys can have 5 or 6 weeks but they are always the same. I want to make Stata and end be weekly so when the first week end I add 7 days. And when the week starts again it starts where week ended. A representation would be
identity Start End week
E 6/18/2020 6/25/2020 1
E 6/25/2020 7/2/2020 2
2D 7/18/2020 7/25/2020 1
2D 7/25/2020 8/1/2020 2
A1 9/6/2020 9/13/2020 1
A1 9/13/2020 9/20/2020 2
I tried a simple method that was creating a sevens column and making the sum to get the end of the week I get and error Addition/subtraction of integers and integer-arrays with Timestamp is no longer supported. Instead of adding/subtracting n, use n * obj.freq
Then I would concat start over minus seven but I don't know how to get around this problem. Any help would be magnificent.