title: creating features for DataFrame from text file in pandas
body: <p>Im looking to create features for a dataframe using feature_names.txt using the following code :</p>
  <pre><code>import pandas as pd
  features = pd.read_csv(&quot;feature_names.txt&quot;, header= None)
  dataset = pd.read_csv(&quot;dataset.csv&quot;)
  dataset.columns = features.values
  </code></pre>
  <p>this outputs the following :</p>
  <p>(id ,)  (age,)  (workclass,)    (fnlwgt,)   (education,)    (education-num,)    (marital-status,)   (occupation,)   (relationship,)</p>
  <p>Im looking to remove the brackets and comma but have using the following code:</p>
  <pre><code>dataset.columns.str.replace(&quot;[()]&quot;, &quot;&quot;)
  
  </code></pre>
  <p>this just makes all the headers nan</p>
  <p>I would appreciate any help,
  Thanks very much.</p>