I am very new to Python and am attempting to use it for some relative humidity data. I am looking at 60 months of data. The files include a Lat and Long file (CSV in a Matrix) and Relative Humidity data (60 CSV Matrix files). What I'm trying to do is correspond the Lat and Long to the value in the Relative Humidity files by turning them into 60 CSV XYZ (latitude, longitude. RH) files - essentially merging the data and converting from matrix to list form. My problem is I don't know how to loop through the RH files.
# Create XYZ CSV file from Latitude, Longitude, and relative_humidity files import csv path = "/Users/msayre1/Desktop/CSV_Input/" longitude =  latitude =  humidity =  with open(path + 'LATITUDE.csv', 'rb') as f: reader = csv.reader(f) latitude = list(reader) with open(path + 'LONGITUDE.csv', 'rb') as f: reader = csv.reader(f) longitude = list(reader) with open(path + 'relative_humidityApr09.csv', 'rb') as f: reader = csv.reader(f) humidity = list(reader) with open(path + 'RH_200904.csv', 'wb') as newFile: newWriter = csv.writer(newFile, delimiter = ',') for row, value in enumerate(latitude): for col, lati in enumerate(value): print lati + "," + longitude[row][col] + "," + humidity[row][col] newWriter.writerow([lati, longitude[row][col], humidity[row][col]])