title: Convert a predictor to categorical in Python
body: <p>Is there any function in Keras that allows me to convert a numeric/continuous predictor into categorical variable quickly? I know we do one-hot encoding but I am looking for something similar like this in R:</p>
  
  <pre><code>var = as.factor(var)
  </code></pre>