Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago