subject

Define a function named read_csv_header with one parameter. This parameter will be a csv reader object (e. g., the value returned when calling the function csv. reader). The first row read using the parameter is the file's header row. The header row contains the keys for the data stored in the CSV file. This function must return a list containing the strings from that header row. The function parameter will be a csv reader object and not a string. This means you do not need the with..as nor create the csv reader in your function, but this will be done in the code calling your function. For example, to execute read_csv_header using a file named "smallDataFile. csv" you would write the following code: with open("smallDataFile. csv") as f_in: csv_r = csv. reader(f_in) header = read_csv_header(csv_r) You would then want to include code to check that header had the expected value. For example, suppose the first line of the file being read by csv_r was: tow_date, tow_reason then the call read_csv_header(csv_r) would need to return: ['tow_date','tow_reason'].

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 14:00, uday50
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
image
Computers and Technology, 24.06.2019 12:00, yagalneedshelp8338
Match the function to its purpose. fast worth 50pts.
Answers: 1
image
Computers and Technology, 24.06.2019 17:00, mrsrobinson1014
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
image
Computers and Technology, 25.06.2019 08:20, chloesmolinski0909
In the following table, column a is column b is and column c is
Answers: 1
You know the right answer?
Define a function named read_csv_header with one parameter. This parameter will be a csv reader obje...

Questions in other subjects: