title: Create intervals for a continuous variable
body: <p>Given the following data frame <code>df</code>:</p>
  
  <pre><code>A      B
  14.5   1
  12.1   3
  14.2   4
  5.0    1
  6.0    3
  8.0    5
  12.0   1
  </code></pre>
  
  <p>I want to create a chart with median values of <code>B</code> per each interval of values in <code>A</code> (step size is equal to 3).</p>
  
  <p>I can create this chart without using intervals.</p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  import seaborn as sns
  
  grouped_df = df.groupby('A')['B'].aggregate(np.median).reset_index()
  plt.figure(figsize=(12,8))
  sns.pointplot(grouped_df.A.values, grouped_df.B.values)
  plt.ylabel('Median B', fontsize=12)
  plt.xlabel('A', fontsize=12)
  plt.show()
  </code></pre>
  
  <p>But in this case the chart looks very messy. Therefore I want to put the values of <code>A</code> into the intervals of 3. How can I do it?</p>