python - Only the first digit of my data gets put in an array -


import numpy np import asciidata  def leesdata():     ra = []     dec = []     data = asciidata.open('s0-2.txt')     in data[1]:         ra.append(float(i))     in data[2]:          dec.append(float(i))     return ra, dec  ra, dec = leesdata() print ra, dec 

when run this:

[-0.04] [0.15, 0.138, 0.124, 0.098, 0.088, 0.078, 0.05, 0.041, 0.02,  0.01, -0.017, -0.004, 0.011, 0.072, 0.079, 0.085] 

so first number of data gets put in array ra, dec works fine. doing wrong?

here file i'm trying open

http://home.strw.leidenuniv.nl/~snellen/ps/s2_pos.dat

normally i'd use combination of open , read this. here's how i'd read in file:

f = open('s0-2.txt', 'r+') ra = [] dec=[] line in f:     if ( not(line.startswith('#')) ):         ra.append( line.split()[1] )         dec.append( line.split()[2])  print ra  print dec 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -