title: How to plot by category over time
body: <p>I have two columns, categorical and year, that I am trying to plot. I am trying to take the sum total of each categorical per year to create a multi-class time series plot.</p>
  
  <pre><code>ax = data[data.categorical=="cat1"]["categorical"].plot(label='cat1')
  data[data.categorical=="cat2"]["categorical"].plot(ax=ax, label='cat3')
  data[data.categorical=="cat3"]["categorical"].plot(ax=ax, label='cat3')
  plt.xlabel("Year")
  plt.ylabel("Number per category")
  sns.despine()
  </code></pre>
  
  <p>But am getting an error stating no numeric data to plot. I am looking for something similar to the above, perhaps with <code>data[data.categorical=="cat3"]["categorical"].lambda x : (1 for x in data.categorical)</code> </p>
  
  <p>I will use the following lists as examples.</p>
  
  <pre><code>categorical = ["cat1","cat1","cat2","cat3","cat2","cat1","cat3","cat2","cat1","cat3","cat3","cat3","cat2","cat1","cat2","cat3","cat2","cat2","cat3","cat1","cat1","cat1","cat3"]
  
  year = [2013,2014,2013,2015,2014,2014,2013,2014,2014,2015,2015,2013,2014,2014,2013,2014,2015,2015,2015,2013,2014,2015,2013]
  </code></pre>
  
  <p>My goal is to obtain something similar to the following picture
  <a href="https://i.stack.imgur.com/ovcQH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ovcQH.png" alt="enter image description here"></a></p>