title: saving a variable column name in text via python
body: <pre><code>col = ['rss','intercept'] + ['coef_x_%d'%i for i in range(1,16)]
  ind = ['model_pow_%d'%i for i in range(1,16)]
  coef_matrix_simple = pd.DataFrame(index=ind, columns=col)
  
  for i in range(1,16):
     coef_matrix_simple.iloc[i-1,0:i+2] = linear_regression(df, power=i, models_to_plot=models_to_plot)
  
  pd.options.display.float_format = '{:,.2g}'.format
  coef_matrix_simple
  
  np.savetxt('output.csv', coef_matrix_simple,  delimiter =" ")
  </code></pre>
  
  <p>I want to save the coef_matrix_simple along with <strong><em>col</em></strong> values as column name and <strong><em>ind</em></strong> values in the csv file. saving the <strong><em>coef_matrix_simple</em></strong> gives only numbers without any column name.</p>