title: How to groupby column of release year by decade
body: <p>I'm working on a dataframe of Netflix's movies. I have a column which has the release year of each one and I would like to group this column by decade.</p>
  <p>The column data type is int64 and when I group my df by release year it looks like this:</p>
  <pre><code>dates = df.groupby(&quot;release_year&quot;, as_index=False).count()
  dates.sort_values('listed_in', ascending= False).head(10)
  
      release_year    listed_in
  70  2018            1147
  69  2017            1032
  71  2019            1030
  72  2020            953
  68  2016            902
  73  2021            592
  67  2015            560
  66  2014            352
  65  2013            288
  64  2012            237
  
  </code></pre>
  <p>Now I want to group them by decade. I've tried this:</p>
  <pre><code>dates.apply(lambda x: (x//10)*10).count()
  </code></pre>
  <p>But it doesn't work.</p>
  <p>What should I do instead?</p>
  <p>Thanks in advance!</p>