Removing columns in python
<p>Having a comma separated file with around 50 columns and several rows, there is a need to remove columns which are always 0 (i.e all values in that column are zero).</p>

<p>The file is read with the following piece of code:</p>

<pre><code>with open('data.txt', 'rb') as f:
    reader.csv.reader(f, delimiter=',')
    for row in reader:
        print row


0 0.1 0.3 0.4 0
0 0.2 0.5 0.3 0
0 0.7 0.9 0.2 0
</code></pre>

<p>How one can exactly remove columns (that are 0) from this memory structure. It would be more better, if there is no re-writing and re-reading to another temporary csv file to achieve this.</p>
