I am trying to calculate the age of horses. All horses share the same birthday regardless of the date they were born - the 1st of August. For example, if a horse was born on 31st of July, it would still be classified as 1 yo despite only being one day old.
I have a dataframe with three columns: FoalDate (the day horse was born), MeetingDate (the day of race meeting), and Age. I am trying to calculate the horses age on a particular meeting date. In the example below, the horse would be a 2 yo because the 1st of August has only passed twice since its foal date.
Example:
Foal Date MeetingDate Age
20/11/2014 30/04/2017 2
I am trying to write code that would replace the 'Age' column (which is currently filled with 0s) with the correct answers.