November 29th, 2012, 10:44 AM
Join Date: Nov 2012
Time spent in forums: 14 m 50 sec
Reputation Power: 0
Load a CSV file to a list
I'm trying to correlate several variables with the following code :
from numpy import corrcoef
from pylab import pcolor, show, colorbar, xticks, yticks
data = csv.reader(open("sales_variables.csv", "rU"))
# plot the correlation matrix
D = corrcoef(data)
To get this working I need to figure a way of getting the CSV object into a list of values that corrcoef is expecting.
Any ideas? I@m very new to Python programming so please excuse my ignorance.