title: How to count frequencies per datetime and category in python
body: <p>I have a following problem.</p>
  <pre class="lang-py prettyprint-override"><code>df_dict = {&quot;uziv_id&quot; : [1, 1, 2, 3], &quot;datetime&quot; : [&quot;2022-09-05 07:25:12&quot;, &quot;2022-09-05 07:25:52&quot;, &quot;2022-09-05 07:42:12&quot;, &quot;2022-09-05 07:43:12&quot;],
             &quot;expedice&quot; : [&quot;A&quot;, &quot;A&quot;, &quot;B&quot;, &quot;A&quot;]}
  
  df = pd.DataFrame(df_dict)
  
  </code></pre>
  <p>I need to count uziv_id per 10 minute interval and per <code>expedice</code>. I try this:</p>
  <pre class="lang-py prettyprint-override"><code>
  df[&quot;time&quot;] = pd.to_datetime(df[&quot;datetime&quot;])
  
  df = (
      df.groupby(pd.Grouper(freq=&quot;10Min&quot;, key=&quot;time&quot;), &quot;exp&quot;)[&quot;uziv_id&quot;]
      .nunique()
      .reset_index(name=&quot;count&quot;)
  )
  df = df.rename(columns={&quot;time&quot;: &quot;interval start&quot;})
  df.insert(1, &quot;interval end&quot;, df[&quot;interval start&quot;] + pd.Timedelta(&quot;10Min&quot;))
  
  </code></pre>
  <p>But I got an error <code>ValueError: No axis named exp for object type DataFrame</code>. What do I do wrong please?</p>