I have a table containing dates and the various cars sold on each dates in the following format (These are only 2 of many columns):
DATE CAR
2012/01/01 BMW
2012/01/01 Mercedes Benz
2012/01/01 BMW
2012/01/02 Volvo
2012/01/02 BMW
2012/01/03 Mercedes Benz
...
2012/09/01 BMW
2012/09/02 Volvo
I perform the following operation to find the number of BMW cars sold everyday
df[df.CAR=='BMW']['DATE'].value_counts()
The result is something like this :
2012/07/04 15
2012/07/08 8
...
2012/01/02 1
But there are some days when no BMW car was sold. In the result, along with the above I want the days where there are zero occurrences of BMW. Therefore, the desired result is :
2012/07/04 15
2012/07/08 8
...
2012/01/02 1
2012/01/09 0
2012/08/11 0
What can I do to attain such a result?