title: data frame to file.txt python
body: <p>I have this dataframe </p>
  
  <pre><code>       X    Y  Z    Value 
  0      18   55  1      70   
  1      18   55  2      67 
  2      18   57  2      75     
  3      18   58  1      35  
  4      19   54  2      70   
  </code></pre>
  
  <p>I want to save it as a text file with this format</p>
  
  <pre><code>   X    Y  Z    Value 
     18   55  1      70   
     18   55  2      67 
     18   57  2      75     
     18   58  1      35  
     19   54  2      70   
  </code></pre>
  
  <p>I tried this code but is not working:</p>
  
  <pre><code>np.savetxt('xgboost.txt', a.values, delimiter ='\t')
  
  TypeError: Mismatch between array dtype ('object') and format specifier ('%.18e %.18e %.18e')
  </code></pre>