I'd like to take the following data, and check for each day whether the animal was observed the previous day, then create a count per day of new animals observed.
import pandas as pd
data = {'Date': pd.to_datetime(['18/08/2018', '18/08/2018', '18/08/2018',
'19/08/2018', '19/08/2018', '19/08/2018',
'19/08/2018', '19/08/2018', '20/08/2018',
'20/08/2018', '20/08/2018']),
'Animal': ['cat', 'dog', 'mouse', 'cat', 'dog', 'mouse', 'rabbit', 'rat', 'lion', 'tiger', 'monkey']
}
df = pd.DataFrame(data)
With a result something like:
1. 18/08/2018 3 2. 19/08/2018 2 3. 20/08/2018 3
I'm very new to Python, so any help very appreciated! Thx.