pandas read_table usecols error with ":"
<p>I am trying to read a certain range of nonconsecutive columns from my file using python pandas read_table function. To that end, I am trying:</p>

<pre><code>df=pd.read_table('genes.fpkm_trackingTest', usecols=[0:4, 8,9, 12:19])
</code></pre>

<p>The idea is that i am trying to use ":" to select the range of number of columns for usecols, rather than using column numbers separated with comma ",". I am getting a  syntax error. If I use commas "," to separate column numbers, then it works fine.</p>

<pre><code>df=pd.read_table('genes.fpkm_trackingTest', usecols=[0,1,2,4, 8,9, 12,13,14,15,16,17,18,19])
</code></pre>

<p>However, that can be cumbersome as sometimes i have to select 40 columns. How can i come around this?</p>

<p>I even tried</p>

<pre><code>usecols=[range(0:4), 8, 9, range(12:19)]
</code></pre>

<p>but it also gave me errors.</p>

<p>I think that should be simple thing to solve but I couldnt find a solution online.</p>