subject

The tab cereal. scsv contains the nutritional information for over 70 cereals. However it's in a format that is rarely used (semi-colon separated values). The reason it's in this format is that a few cereals have commas in their name (e. g. Fruit & Fibre Dates, Walnuts, and Oats). For this lesson you will convert this format to the more common csv file format (comma separated values). There are two standard ways to treat values with commas in them when writing out a csv file: Put the entire value in quotes (e. g. "Fruit & Fibre Dates, Walnuts, and Oats") Use a different separator (e. g. Fruit & Fibre Dates; Walnuts; and Oats) We will chose the latter and use semicolons for those values that have commas in them. Write a function named convert_table. It has two parameters a filename to be read (the scsv file) and a filename to be written (the csv file). Name them filename_in and filename_out. Open, read, and parse the scsv file (i. e. filename_in) Write out the same contents to filename_out but separate the values (columns) with commas. For those values that have commas in them, replace the commas with semicolons. Be sure to end each line (except the last line) with a newline. Return True from the function. Normally you would return a boolean indicating success or failure do NOT use any helper libraries (e. g. pandas, csv, etc).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 24.06.2019 02:10
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
When you type january in a cell, then copy it using the fill handle to the cells below and the data automatically changes to february, march, april, and so on, what is this feature called? auto fill automaticcopy monthfill textfill
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
What is the main difference between cloud computing and saas? cloud computing is a platform, and saas is software. cloud computing is software, and saas is a platform. cloud computing is a service, and saas is software. cloud computing is a service, and saas is a platform.
Answers: 1
You know the right answer?
The tab cereal. scsv contains the nutritional information for over 70 cereals. However it's in a for...
Questions
question
Chemistry, 30.04.2021 14:40
question
Mathematics, 30.04.2021 14:40
question
Mathematics, 30.04.2021 14:40
question
Mathematics, 30.04.2021 14:40
question
Mathematics, 30.04.2021 14:40
question
Health, 30.04.2021 14:50
Questions on the website: 13722362