I learned how to script in python with version 2.7; however, the system I am coding on now only has version 2.4.3. I am trying to open a file titled "input.csv", read columns 0, 1, 2 and 3, while simultaneously skipping the first row since it contains header information that I do not want. The code I am attaching works fine with Python 2.7.9, but does not work with 2.4.3. Can someone point me in the right direction as to how this block of code should be written.
import csv # imports the library that enables functionality to read .csv files
MATPRO_Temperature = [] # List to hold MATPRO experimental temperatures
MATPRO_Density = [] # List to hold MATPRO experimental densities
MATPRO_Conductivity = [] # List to hold MATPRO experimental thermal conductivities
MATPRO_References = [] # List to hold MATPRO references for each measurement
File_Name = 'Input.csv' # - The relative address for the MATPRO database containing
# the thermal conductivity measurements
# This section opens the .csv file at the address 'File_Name' and reads in its data into lists
with open(File_Name) as csvfile:
next(csvfile) # This forces the reader to skip the header row of hte .csv file
readCSV = csv.reader(csvfile, delimiter = ',')
for row in readCSV:
MATPRO_Temperature.append(row[0])
MATPRO_Density.append(row[1])
MATPRO_Conductivity.append(row[2])
MATPRO_References.append(row[3])