title: convert data with LabelEncoder
body: <p>I wrote this function to convert categorical features with LabelEncoder</p>
  <pre><code>#convert columns to dummies with LabelEncoder
  cols = ['ToolType', 'TestType', 'BatteryType']
  #apply ene hot encoder
  le = LabelEncoder()
  for col in cols:
      data[col] = data[col].astype('|S') #convert object to str type before apply label encoder
      le.fit(ravel(data[col]))
      data[col] = le.transform(ravel(data[col]))
  </code></pre>
  <p>There are null values in those columns, but there is an error like this</p>
  <pre><code>TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
  </code></pre>
  <p>Does anyone know how to help me to fix this? Thank you</p>