Rev. | dd33bff1ad7427d901c06fdd5e2ae13ae4e7eadc |
---|---|
大小 | 817 字节 |
时间 | 2009-01-19 23:55:24 |
作者 | iselllo |
Log Message | This file reads a two-column csv file where the first column is given by a list of the names of the
|
#! /usr/bin/env python
import scipy as s
import csv
def read_input(filename):
param_name_list=[]
param_value_list=[]
reader = csv.reader(open(filename, 'r'), delimiter = ',')
line = 0
IndexHeader = reader.next()
line = line+1
for line in reader:
#print line
param_name, param_value = line[0], line[1]
param_name_list.append(param_name)
param_value_list.append(float(param_value))
#print "param_name_list is, ", param_name_list
#print "param_name_list is, ", param_value_list
param_arr=s.asarray(param_value_list)
#print "param_arr is, ", param_arr
#print "param_name_list[2] is, ", param_name_list[2]
return param_arr
input_arr=read_input("input.csv")
print "input_arr is, ", input_arr
print "So far so good"