title: Adding header/column to my .csv file
body: <p>My current code:</p>
  
  <pre><code>file='filelocation.sav'
  finalfile = 'filelocation.csv'
  
  s=spio.readsav(file, python_dict=True, verbose=True)
  amf=np.asarray(s["amf"])
  
  d=[amf]
  df=pd.DataFrame(data=d)
  df=df.T
  df.to_csv(finalfile,sep= ' ', encoding = 'utf-u', header=True)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/qCxa3.png" rel="nofollow noreferrer">This is my current output</a></p>
  
  <p>I would like my output to look like this:</p>
  
  <pre><code>   amf
  0  6.685
  1  6.84
  2  7.0
  3  7.16
  4  7.33
  5  7.51
  6  7.70
  </code></pre>
  
  <p>etc. Basically I want the header to line up with the data it represents so that I can properly call upon said data and plot. </p>
  
  <p>Another issue I noticed was that when I asked jupyter with </p>
  
  <pre><code>file.columns
  </code></pre>
  
  <p>to tell me the index, I was returned this output:</p>
  
  <pre><code>Index([u' 0 1 2 3 4 5 6'], dtype='object)
  </code></pre>
  
  <p>which leads me to believe that there is only one index being accounted for, when I'd like to have 7 specific indices (including "0").</p>
  
  <hr>
  
  <p>Edited past here:</p>
  
  <p>So: It looks like another issue I'm having is that although the number of rows I intend to have is about 87000 in length, it's showing through as having 87000 columns. </p>
  
  <p>Looks like I need to make some changes to that my array "amf" is created as a row and not a column. </p>