title: How to factorize selected columns in pandas
body: <p>I want to implement a function that automatically assigns a numeric value to an object.
  Here is my code:</p>
  
  <pre><code>column_list = ['datum', 'parameter_name', 'sample_duration', 'pollutant_standard', 'units_of_measure']
  def gnumeric_func(data, columns):
      data[columns] = pd.factorize(data.columns)[0]
  
  data = pd.DataFrame(data, column_list)
  gnumeric_func(data, column_list)
  </code></pre>
  
  <p>What's wrong?</p>