title: Get the amount of open tasks for any specific date with Python/Pandas
body: <p>I have a list of tasks with start and end date and i need to know how many open tasks i had on a specific day.</p>
  <p>My current approach for a solution is a cross join with a calendar table:</p>
  <pre><code>import pandas as pd
  
  df = pd.DataFrame({
      'ID': [101, 102, 103],
      'Start' : ['01.01.2022', '02.01.2022', '03.01.2022'],
      'End' : ['03.01.2022', '08.01.2022', '05.01.2022']
  })
  
  df['Start'] = pd.to_datetime(df['Start'], format=&quot;%d.%m.%Y&quot;)
  df['Ende'] = pd.to_datetime(df['End'], format=&quot;%d.%m.%Y&quot;)
  
  calender = pd.DataFrame({
      'Day': pd.date_range(start=df['Start'].min(), end=df['End'].max())
  })
  
  df = pd.merge(left=df, right=calender, how='cross')
  df = df.loc[(df['Day'] &gt;= df['Start']) &amp; (df['Day'] &lt;= df['End'])]
  
  df.pivot_table(index='Day', aggfunc='count', values='ID')
  </code></pre>
  <p>This solution works well on a small set of data, but my original data has 500k items and calendar helptable with 2k items. So the cross join leads to 1 billion rows, what seems to be very inefficent and slows down the system.</p>
  <p>Is there a better way to solve this with pandas?</p>