title: Python: Pandas, Text File to DataFrame
body: <p>I have a text file which is of the form: <img src="https://s13.postimg.org/4aw2ivx1j/efefadf.png" alt="txt.file"></p>
  
  <p>I want to create a dataframe from this, using separated by the whitespace, as columns, and use the letters at the top as column names, then export the dataframe to excel. This is the code I have constructed so far:</p>
  
  <pre><code>import pandas as pd
  
  data = pd.read_csv('testrun.txt', delim_whitespace=True, header = None, names = ["n", "p", "d", "f", "g"])
  
  df = pd.DataFrame(data)
  
  df.to_excel(r'C:\Users\"my_name"\Desktop\spdsht.xlsx')
  </code></pre>
  
  <p>So far this code sucks the n, p, d, f, g into the data frame as just another row. Is there anyway I can omit this first row, and have pandas append it as the column names? As you can see, I already put the column names in manually, but that doesn't get rid of the n, p, d, f, g within the first row. </p>