title: How to split a list\array according to some related values into 3 lists
body: <p>I have python homework which asks me to plot current-time and voltage-time graphs according to given values. Values of time are in decimals; However values of voltage and current are binaries. All values are stored in a text file I have to import them from. I know how graph them but I don't know how to split time values, current values, and voltage values into 3 lists. Also I don't know which code I should write to change from binary to integer and to determine the sign of each of them.  The leftmost digit of the current, voltage binary values determines the sign of the value, if digit=0 then it is positive, if digit=1 then it is negative.</p>
  
  <p>I have tried:</p>
  
  <pre><code>import numpy as np
  
  t = []
  I = []
  v = []
  
  with open("rawdata.txt") as DATA:
      data_ = [line.split() for line in DATA]
      data = np.array(data_)
      print(data[:,0])
  </code></pre>
  
  <p>I have tried the last line's cod to print just values of time but it did not work.</p>
  
  <p><strong>Edit: Error message:</strong> </p>
  
  <pre><code>Traceback (most recent call last): 
  File "C:\Users\mustafa ghanım\Desktop\İTÜ - BAHAR 2016 DÖNEMİ\PYTHON\Proje\proje.py", line 5, in &lt;module&gt; print(data[:,0]) 
  IndexError: too many indices for array
  </code></pre>
  
  <hr>
  
  <pre><code> current=[];voltage=[];import numpy as np
   with open("rawdata.txt") as DATA:
   data_=[line.split()for line in DATA if not line.isspace()]
   data=np.array(data_)
   t=data[1:,0]
   I=data[1:,1]
   v=data[1:,2]
   print ("Time:",t)
   print (I)
   print (v)
   for i in I:
       d_c=int(i,2)
       current.append(d_c)
   print("Current:",current)
   for j in v:
      d_v=int(j,2)
      voltage.append(d_v)
  print("Voltage",voltage)
  </code></pre>
  
  <p>Sorry for my late responding, I am trying now to export my new decimal values which I have constructed list foe each of them (values of time,voltage,current,power) as decimals. I am asked now to export these values as a table which will include rows and columns of course to a text file called "powdata.txt"..any idea for which code should I use?!
  I have tried to write:</p>
  
  <pre><code> powdata=open("powdata.txt","w")
   for a in t:
     powdata.write("%s\n"%a)
   for b in current:
   "and so on!"
  
   powdata.close()
  </code></pre>
  
  <p>Unfortunately this kind of codes just  writes data in the text file vertically I mean not like the suggested table. 
  Unfortunately this kind of codes just  writes data in the text file vertically I mean not like the suggested table. </p>
  
  <pre><code>          time(s) voltage(V)    current(A)
             0    0000000000      101101010
             0.0005   0000110001  101011000
            0.001 0001100000      101011000
  </code></pre>
  
  <p>such a table must be written in the new file.</p>