I am learning about dataframes and am studying various properties of animal sightings over many days. I created a dataframe that counts the number of occurrences of these animals:
>>> df
Type Count
date
2015-07-11 Dog 2
2015-07-11 Cat 1
2015-07-12 Cat 2
2015-07-13 Pig 1
On days where the animal did not appear, I want to have the count as 0. The dataframe I want should look like:
>>> df
Type Count
date
2015-07-11 Dog 2
2015-07-11 Cat 1
2015-07-11 Pig 0
2015-07-12 Dog 0
2015-07-12 Cat 2
2015-07-12 Pig 0
2015-07-13 Dog 0
2015-07-13 Cat 0
2015-07-13 Pig 1
Note: It is given that I know all the values of Type i.e. Cat, Dog, Pig.
I'm completely stumped on how to add these additional rows to the DataFrame. This is probably a very stupid question about how to append rows with a specific index.
Any help will be lovely. Thank you!