subject
Computers and Technology, 11.12.2021 08:20 mia7791

Note: Must be done in python 7.8 LAB: Word frequencies (lists)
Write a program that first reads in the name of an input file and then reads the file using the csv. reader() method. The file contains a list of words separated by commas. Your program should output the words and their frequencies (the number of times each word appears in the file) without any duplicates.

Ex: If the input is:

input1.csv
and the contents of input1.csv are:

hello, cat, man, hey, dog, boy, Hello, man, cat, woman, dog, Cat, hey, boy
the output is:

hello 1
cat 2
man 2
hey 2
dog 2
boy 2
Hello 1
woman 1
Cat 1
Note: There is a newline at the end of the output, and input1.csv is available to download.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 09:00, lisacarter0804
Why might you chose to crest a function resume
Answers: 1
image
Computers and Technology, 24.06.2019 20:30, jalenevoyles
Which key should you press to leave the cell as it originally was? a. delete b. cancel c. backspace d. enter
Answers: 1
image
Computers and Technology, 25.06.2019 00:30, alinton06
What is a typeface? a. a collection of similar text b. a collection of similar fonts c. a collection of similar designs d. a collection of similar colors e. a collection of similar images
Answers: 1
image
Computers and Technology, 25.06.2019 07:50, demilasyone01
In addition to the four primary computer operations, today's computers typically also perform functions.
Answers: 1
You know the right answer?
Note: Must be done in python 7.8 LAB: Word frequencies (lists)
Write a program that first re...

Questions in other subjects: