How to write a txt with the following list using pandas?
<p>Hello I am using pandas to process a excel file my code looks as follows:</p>

<pre><code>df = xl.parse("Sheet1")

important_Parameters="bash generate.sh --companyCode"+" "+df[u'Company Code '].astype(str)+" "+"--isaADD"+df[u'TP Interchange Address '].astype(str)+" "+"--gsADD"+" "+df[u'TP Functional Group Address '].astype(str)

print(important_Parameters)
</code></pre>

<p>Everything works well, when I print my code it looks fine, I wish to write a txt file with the contain of my object called:</p>

<pre><code>important_Parameters
</code></pre>

<p>I tried with:</p>

<pre><code>important_Parameters.to_pickle("important.txt")
</code></pre>

<p>but the result does not seem like the printing, I believe that is due to the way that I took to write in disk,</p>

<p>I also tried with:</p>

<pre><code>important_Parameters.to_string("importantParameters2.txt")
</code></pre>

<p>However this gave me a more friendly representation of the data but the result is including the number of the raw and also the rows's are not completed they look as follows:</p>

<pre><code>bash generate.sh --companyCode 889009d --isaADD...
</code></pre>

<p>it is showing this ...</p>

<p>I would like to appreciate any suggestion to produce a simple .txt file called importante.txt with my result, the containing of important_Parameters, thanks for the support</p>

<p>I order to include more details my output looks like, I mean the result of the print:</p>

<pre><code>0       bash generate.sh --companyCode 323232 --isaADD...
1       bash generate.sh --companyCode 323232 --isaADD...
2       bash generate.sh --companyCode 323232 --isaADD...
</code></pre>

<p>Panda dataframes have more than a few methods for saving to files. Have you tried <code>important_Parameters.to_csv("important.csv")</code>? I'm not certain what you want the output to look like.</p>

<p>If you want it tab-separated, you can try:
    <code>important_Parameters.to_csv("important.csv", sep='\t')</code></p>

<p>If the file absolutely must end in <code>.txt</code>, just change it to: <code>important_Parameters.to_csv("important.txt")</code>. CSVs are just specifically formatted text files so this shouldn't be a problem.</p>

python pandas