With the Start Date and End Date given , finding date counts in Pandas
Try this. It is a bit ugly, as I couldn't manage to get a solution without iterating through one of the dataframes. It could be done by iterating over the original data, or the new df with the list of all dates. 

I had a similar problem, any cleaner ways of doing this would be appreciated.

import pandas as pd

df = pd.DataFrame(data={'Item':['A','A','B','A'], 
                        'StartDate':['2018-01-01','2018-01-07', '2018-01-03','2018-01-03'],
                        'EndDate': ['2018-01-04','2018-01-08','2018-01-05','2018-01-05']})
df['StartDate'] = pd.to_datetime(df['StartDate'])
df['EndDate'] = pd.to_datetime(df['EndDate'])


index = pd.MultiIndex.from_product([['A','B'],pd.date_range(start = df.StartDate.min(), end = df.EndDate.max())], names=['item', 'date'])
new_df = pd.DataFrame(index = index, data = {'counts':0})

dates_list = new_df.index.get_level_values(1)
items_list = new_df.index.get_level_values(0)
for row in df.itertuples():
  new_df.counts[(items_list == row.Item) &amp; (dates_list&gt;=row.StartDate) &amp; (dates_list&lt;= row.EndDate)] += 1

print(new_df)


Which gives this. You can remove the multi-index later if needed

                 counts
item date              
A    2018-01-01       1
     2018-01-02       1
     2018-01-03       2
     2018-01-04       2
     2018-01-05       1
     2018-01-06       0
     2018-01-07       1
     2018-01-08       1
B    2018-01-01       0
     2018-01-02       0
     2018-01-03       1
     2018-01-04       1
     2018-01-05       1
     2018-01-06       0
     2018-01-07       0
     2018-01-08       0