title: how to convert value_counts() of pd.cut to a dictionary
body: <p>Newbie to pandas,</p>
  
  <p>after searching I found pandas is very suitable to make my data divided by parts for further display on charts.</p>
  
  <p>Here is what I do with it:</p>
  
  <pre><code>print pd.cut(data_lst, 5).value_counts()
  </code></pre>
  
  <p>the <code>data_lst</code> is a list of numbers and above line of code give a pretty neat result like this which is exactly what I need:</p>
  
  <pre><code>(-0.513, 25.6]      9
  (25.6, 51.2]       43
  (51.2, 76.8]      160
  (76.8, 102.4]       0
  (102.4, 128.0]    302
  </code></pre>
  
  <p>but I just want the result to be a dict as the format of:</p>
  
  <pre><code>{
   "(-0.513, 25.6]":9,
   "(25.6, 51.2]":43,
   "(51.2, 76.8]":160,
   "(76.8, 102.4]":0,
   "(102.4, 128.0]":302    
  }
  </code></pre>
  
  <p>So that I could save that to the database, but I couldn't find a way to get that result other than print the <code>value_counts()</code> out.</p>