Question: This is a python question. In the following code cell, write a function called convert() that takes a string, filename, and an int, column that

This is a python question.

In the following code cell, write a function called convert() that takes a string, filename, and an int, column that is the column number that contains the values that require conversion from string to float and returns col_values, the list of values contained in the column as float values.

Two conditions:

Make sure to strip the newline character at the end of the line.

From the description of examples above, observe the utility of next() or slicing in order to skip the header.

def convert(filename, column): ''' converts a column in a file with floating point values from string to a list of float values. ''' col_values = [] #code here;;;;; there is a file called test_file, which is just a big big data of texts.

with open(test_file,'r') as filename:

return col_values

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!