Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Im trying to make a function the reads in a file and store the numerical values of each column in lists for computation however when

Im trying to make a function the reads in a file and store the numerical values of each column in lists for computation however when i run this line of code it gives me the message "none" even though I have the file saved on my computer and have used the exact same line of code in a previous program without defining it as a variable which works perfectly dont know what exact I'm doing wrong here image text in transcribed
image text in transcribed
image text in transcribed
def readCSVFile(fileName): openFile = open(fileName) headings = openFile.readline().s headingsLength = (len(headi observations = 11 all empty lists columns = ] values = [] for header in headings: observations.append (1) for row in openFile: Columns - row.strip().split(",") values.append (columns) for nun in range(headingsLength): observations (num).append (float(columns [num])) #observations (0)=Max Temp, observations (1)-Min Te 45 print (readCSVFile("reducedweather.csv")) In [98]: runfile('/Users/matthewlaluk/Downloads/untitled2.py', wdir='/Users/ matthewlaluk/Downloads') None In 1991: nloads * reducedwease... Open with Numbers onsole 1/A .': 1'36.7', '1 Max Temp Min Temp -18.3 -28.3 -4.5 -18.5 3.8 -6.3 ather.csv Nina -8.4 -16.5 -19.3 -15.5 reducedweather.c -9 -15.7 SV -13.7 -13.8 -5.1 -6.4 -11.4 -3.7 -18.8 -23.5 -27.8 -27.4 -30.2 -17.9 -25.7 -31.9 -33.2 - 11.5 -5'). 29.5,15.4 ': [ - 10.4 -9.4 [95]: runfile('/Users/m thewlaluk/Downloads) -0. TextIowrapper name=' - 19.6 -29 -24.3 -33.2 [96]: runfile('/Users/m tthewlaluk/Downloads) ax Temp. Min Temp -23.7 - 19.1 -32.7 -30.8 -26.7 -18.4 1971: run flellisers /

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions