title: How to split continuous data into groups?
body: <p>I have two data sets, the first one with discrete data and the second one with continuous data:</p>
  
  <pre><code>import numpy as np
  
  # discrete
  data1 = [1, 1, 2, 2, 2, 3, 4, 4,7, 7, 7, 7, 7, 7]
  
  # continuous
  data2 = np.random.normal(size=100)
  </code></pre>
  
  <p>Now I want to calculate frequencies. It's straightforward for data1, since it contains discrete values:</p>
  
  <pre><code>import collections
  c = collections.Counter(data1)
  sum = sum(c.values())
  for key,val in c.iteritems():
     print([key,float(val)/sum])
  </code></pre>
  
  <p>How can I do the same for continuous numbers? From theory I know that continuous data must be grouped. Only after this it can be represented as a bar chart. So, how to group the data in python?</p>