title: pandas cut(): how to convert nans? Or to convert the output to non-categorical?
body: <p>I am using pandas.cut() on dataframe columns with nans. I need to run groupby on the output of pandas.cut(), so I need to convert nans to something else (in the output, not in the input data), otherwise groupby will stupidly and infuriatingly ignore them.</p>
  <p>I understand that cut() now outputs categorical data, but I cannot find a way to add a category to the output. I have tried add_categories(), which runs with no warning nor errors, but doesn't work because the categories are not added and, indeed, fillna fails for this very reason. A minimalist example is below.</p>
  <p>Any ideas?</p>
  <p>Or is there maybe an easy way to convert this categorical object to a non-categorical one? I have tried np.asarray() but with no luck - it becomes an array containing an Interval object</p>
  <pre><code>import pandas as pd
  import numpy as np
  
  x=[np.nan,4,6]
  intervals =[-np.inf,4,np.inf]
  out_nolabels=pd.cut(x,intervals)
  out_labels=pd.cut(x,intervals, labels=['&lt;=4','&gt;4'])
  out_nolabels.add_categories(['missing'])
  out_labels.add_categories(['missing'])
  
  print(out_labels)
  print(out_nolabels)
  
  out_labels=out_labels.fillna('missing')
  out_nolabels=out_nolabels.fillna('missing')
  </code></pre>