csv - Importing data in Spyder-Python -


i'm trying import data (csv type) spyder (it has import data option-green arrow, know command default?) , error: 'nonetype' object has no attribute 'send'

also, have tried numpy.genfromtxt("file.csv", delimiter = ',') , numpy.loadtxt("file.csv", delimiter = ',') don't work. working python 3.2.3 , use numpy , scipy (imported before execute previuos commands).

example of datafile:

timestamp,timestamp,timestamp,timestamp,record,net_shortwave_avg (wm-2),net_longwave_avg(wm-2),net_rad_avg(wm-2 ) 12/21/2012 11:00:00,1100,12,11,0,556.0623,-131.1266,424.9357 12/21/2012 11:01:00,1101,12,11,1,564.877,-132.1396,432.7373 

the loadtxt function, default, tries convert float. getting confused text in header , datetime objects in first column. can tell how use datetime objects, , can have read header. however, simplest thing tell loadtxt ignore first row , first column, this:

data = np.loadtxt('data.csv',delimiter=',',usecols=range(1,7),skiprows=1) 

it might convenient unpack data separate variables, (i'm kinda guessing of fields are):

day,hour,minute,net_shortwave_avg,net_longwave_avg,net_rad_avg =  np.loadtxt('data.csv',delimiter=',',usecols=range(1,7),skiprows=1,unpack=true) 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -