title: Converting Binned Values into Categorical
body: <p>I am working on the Titanic Dataset(Kaggle) competition. One of the columns in the dataset is Fare, which contains float values. For EDA I have converted the Fare columns into bins, and assigned labels to the bins. The problem is that some of the labels are assigned to np.nan.</p>
  
  <pre><code>  Fare          1284 non-null float64
  </code></pre>
  
  <p>Some sample Values:</p>
  
  <pre><code>  0     7.2500
    1    71.2833
    2     7.9250
    3    53.1000
    4     8.0500
  </code></pre>
  
  <p>When I convert the Fare column into bins using qcut:</p>
  
  <pre><code>      dataset['FareBin'] = pd.qcut(dataset['Fare'], 4) 
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>      (-0.001, 7.896]      337
        (14.054, 30.071]     322
        (30.071, 512.329]    320
        (7.896, 14.054]      305
  </code></pre>
  
  <p>The problem arises when I want to assign labels to the FareBin column</p>
  
  <pre><code>       label1=[1,2,3,4]
         bin1=[-0.001,7.896,14.054,30.071,512.329]
         dataset['FareBin']=pd.cut(dataset['Fare'],bin1,labels=label1)
  </code></pre>
  
  <p>I don't know what the problem is. Also if there is a better way to do this please tell me.
  Thanks for taking the time to go through this.</p>