title: How to create a new column in a Pandas DataFrame using pandas.cut method?
body: <p>I have a column with house prices that looks like this:</p>
  
  <pre><code>0          0.0
  1    1480000.0
  2    1035000.0
  3          0.0
  4    1465000.0
  5     850000.0
  6    1600000.0
  7          0.0
  8          0.0
  9          0.0
  Name: Price, dtype: float64
  </code></pre>
  
  <p>and I want to create a new column called data['PriceRanges'] which sets each price in a given range. This is what my code looks like:</p>
  
  <pre><code>data = pd.read_csv("Melbourne_housing_FULL.csv")
  data.fillna(0, inplace=True)
  
  for i in range(0, 12000000, 50000):
      bins = np.array(i)
      labels = np.array(str(i))
  
  
  data['PriceRange'] = pd.cut(data.Price, bins=bins, labels=labels, right=True)
  </code></pre>
  
  <p>And I get this Error message:
  TypeError: len() of unsized object</p>
  
  <p>I've been trying different approaches and seem to be stuck here. I'd really appreciate some help.</p>
  
  <p>Thanks, 
  Hugo</p>