title: How to get odd column headers in Python?
body: <p>I have data in file as shown below:</p>
  
  <p><strong>odd_column.dat</strong></p>
  
  <pre><code>X1  X2  X3  X4  X5  X6  X7
  1   1   1   1   2   2   2
  2   2   4   2   5   5   3
  3   3   9   3   10  10  4
  4   4   16  4   17  17  5
  5   5   25  5   26  26  6
  6   6   36  6   37  37  7
  7   7   49  7   50  50  8
  8   8   64  8   65  65  9
  9   9   81  9   82  82  10
  </code></pre>
  
  <p>And I am trying to get the odd column headers with this code (which does not work):</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>import numpy as np
  with open('odd_column.dat', "r") as data:
      while True:
          line = data.readline()
          if not line.startswith('#'):
              break
      data_header = [i for i in line.strip().split('\t') if i]
  odd_column_header = data_header[n for n in (1, 3, 5, 7)]
  </code></pre>
  
  <p>I have given only 7 total columns as an example. I would like to generalize it for thousands of columns, so that I get the headers of only the odd columns. How can this be done in Python?</p>