SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
9.8 LAB: Word Count Weite a program that first reads in the raime of an inout file and then reada
the file sing the cov readed0 method The fik contains mit ple lines : each a comma segarated list
of words. The program must outeut the words and theit frequehbies tive number of tenes eoch
wers appeats in the fila) witheut any duplicates and daregarcing case (output the words in lower
case) Why do this? in case you are wondenng wry it woudd be important to calcubete bow many
times a word oceurted a a documxent. this is a ocnoept known as ferm trequency and is a concept
oftien used in information ietreval in fact, one of the ear lent papers related to Big Daia discusaes
how Google did word count but at a much latger scide - they were doing t across alt of the
documents they had crawicd in bulding thes search inder. Example: If theinput is cintoniesy and
the contents of Cintor eav consusted of the folowing 4 knes If, there, is, one, needage, that,
echees, forth, fren, thia, conference let, it, be, tkat, humss, rhahti, are, ,youne's, at rights, and,
wocen'a, righti aro, hueian, rtabtin, ence, and, for, akl, Wet, wes, not, fotget, that, ansed the outhut
is if -1 chere - 1 ts- 1 one-1 tesaage - 1 that -3 achoes - 1 forte -1tran--1thin1obaferuace-11it=21t1
be=2himan4fightn5are=dmonea2and=3iopce=1fer-1a.11-1iu=1inot=1furget:=1afope=1those=1the
3ituht=2to-2apeai=1freely=1hisard1 Notes: - The curient versian of Python stares dictionary
entries in the order in which dects were mserted - The itenat) method retums all of the keyvalue
pair entries from a dectonary and can be comerted to a lat. For esample if a dictionary was named
myydict, a ast (inorder) of af of the entries can be gensrated by caling 1 ist ( my_diec.itena () ).
Each item in the list would be a tuple wth the key and value for an entiy: - Similarly
sst(nyydetkeys0) will generate a liat of the keys (in ordes)- The cument version of Python stores
dictionary entries in the order in which items were ingerted - The items () method relurns all of the
keyvalue pair entriea from a dictionary and can be corverted to a fat. For example, if a dictionary
was named my_dict, a lst (in ordet) of all of the entries can be generated by calling 1i=1 fy diet.
items() ). Each item in the list would be a taple with the key and value for an entry. - Similathy. list
my, idict keys0) will generate a jst of the keys (in order). - Output words in oeder of their first
occurfence in the fili - The file Clintoncsv is available to download

Weitere ähnliche Inhalte

Ähnlich wie 98 LAB Word Count Weite a program that first reads in the .pdf

Mastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operationsMastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operationsRuth Marvin
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2sadhana312471
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answerskavinilavuG
 
Introduction to Linux Slides.pptx
Introduction to Linux Slides.pptxIntroduction to Linux Slides.pptx
Introduction to Linux Slides.pptxhazhamina
 
Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxfredharris32
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answersRojaPriya
 
Paper id 42201608
Paper id 42201608Paper id 42201608
Paper id 42201608IJRAT
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Examshishamrizvi
 
An Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileAn Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileIDES Editor
 
Python introduction
Python introductionPython introduction
Python introductionleela rani
 
Fp growth algorithm
Fp growth algorithmFp growth algorithm
Fp growth algorithmPradip Kumar
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To PythonVanessa Rene
 
Hello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfHello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfactioncbe1
 

Ähnlich wie 98 LAB Word Count Weite a program that first reads in the .pdf (20)

Mastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operationsMastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operations
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
Introduction to Linux Slides.pptx
Introduction to Linux Slides.pptxIntroduction to Linux Slides.pptx
Introduction to Linux Slides.pptx
 
Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docx
 
Phython presentation
Phython presentationPhython presentation
Phython presentation
 
A-Study_TopicModeling
A-Study_TopicModelingA-Study_TopicModeling
A-Study_TopicModeling
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Paper id 42201608
Paper id 42201608Paper id 42201608
Paper id 42201608
 
Advance python
Advance pythonAdvance python
Advance python
 
Pa1 session 2
Pa1 session 2 Pa1 session 2
Pa1 session 2
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
Python ppt_118.pptx
Python ppt_118.pptxPython ppt_118.pptx
Python ppt_118.pptx
 
An Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileAn Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired File
 
Python introduction
Python introductionPython introduction
Python introduction
 
Fp growth algorithm
Fp growth algorithmFp growth algorithm
Fp growth algorithm
 
Fp growth algorithm
Fp growth algorithmFp growth algorithm
Fp growth algorithm
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Hello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfHello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdf
 

Mehr von sastaindin

A 7 year 15000 bond paying a coupon rate of 475 compound.pdf
A 7 year 15000 bond paying a coupon rate of 475 compound.pdfA 7 year 15000 bond paying a coupon rate of 475 compound.pdf
A 7 year 15000 bond paying a coupon rate of 475 compound.pdfsastaindin
 
A 25 yearold graduate student enters the student health ce.pdf
A 25 yearold graduate student enters the student health ce.pdfA 25 yearold graduate student enters the student health ce.pdf
A 25 yearold graduate student enters the student health ce.pdfsastaindin
 
a 2 pts Construct the final Fibonacci heap after the fol.pdf
a 2 pts Construct the final Fibonacci heap after the fol.pdfa 2 pts Construct the final Fibonacci heap after the fol.pdf
a 2 pts Construct the final Fibonacci heap after the fol.pdfsastaindin
 
A 2010 Pew Research poll asked 1306 Americans From what yo.pdf
A 2010 Pew Research poll asked 1306 Americans From what yo.pdfA 2010 Pew Research poll asked 1306 Americans From what yo.pdf
A 2010 Pew Research poll asked 1306 Americans From what yo.pdfsastaindin
 
a 1 The first step is to understand the requirements of th.pdf
a 1 The first step is to understand the requirements of th.pdfa 1 The first step is to understand the requirements of th.pdf
a 1 The first step is to understand the requirements of th.pdfsastaindin
 
A 10 year old develops severe pharyngitis at summer camp He.pdf
A 10 year old develops severe pharyngitis at summer camp He.pdfA 10 year old develops severe pharyngitis at summer camp He.pdf
A 10 year old develops severe pharyngitis at summer camp He.pdfsastaindin
 
A modeling study of the stomatogastric ganglion STG of th.pdf
A  modeling study of the stomatogastric ganglion STG of th.pdfA  modeling study of the stomatogastric ganglion STG of th.pdf
A modeling study of the stomatogastric ganglion STG of th.pdfsastaindin
 
9 Using the key choices complete the crossword puzale by a.pdf
9 Using the key choices complete the crossword puzale by a.pdf9 Using the key choices complete the crossword puzale by a.pdf
9 Using the key choices complete the crossword puzale by a.pdfsastaindin
 
9 Sickle Cell Anemia is a condition that shows codominance.pdf
9 Sickle Cell Anemia is a condition that shows codominance.pdf9 Sickle Cell Anemia is a condition that shows codominance.pdf
9 Sickle Cell Anemia is a condition that shows codominance.pdfsastaindin
 
A Blastula aamas B zigot aamas C Morula aamas D.pdf
A  Blastula aamas   B  zigot aamas   C  Morula aamas   D.pdfA  Blastula aamas   B  zigot aamas   C  Morula aamas   D.pdf
A Blastula aamas B zigot aamas C Morula aamas D.pdfsastaindin
 
97 Using the table for the t distributions make an assess.pdf
97 Using the table for the t distributions make an assess.pdf97 Using the table for the t distributions make an assess.pdf
97 Using the table for the t distributions make an assess.pdfsastaindin
 
925 Match the following generally accepted accounting princ.pdf
925 Match the following generally accepted accounting princ.pdf925 Match the following generally accepted accounting princ.pdf
925 Match the following generally accepted accounting princ.pdfsastaindin
 
8En Alemania los trabajadores Seleccione uno a pued.pdf
8En Alemania los trabajadores    Seleccione uno  a pued.pdf8En Alemania los trabajadores    Seleccione uno  a pued.pdf
8En Alemania los trabajadores Seleccione uno a pued.pdfsastaindin
 
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
9Tara asiste a una escuela secundaria en un rea urbana Q.pdfsastaindin
 
918 LAB Sorting user IDs Given a main that reads user ID.pdf
918 LAB Sorting user IDs Given a main that reads user ID.pdf918 LAB Sorting user IDs Given a main that reads user ID.pdf
918 LAB Sorting user IDs Given a main that reads user ID.pdfsastaindin
 
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdfsastaindin
 
9 You are studying the molecular behavior of myosin II S1 .pdf
9 You are studying the molecular behavior of myosin II S1 .pdf9 You are studying the molecular behavior of myosin II S1 .pdf
9 You are studying the molecular behavior of myosin II S1 .pdfsastaindin
 
9 What will be the outgut of the C program Aincluderstdich.pdf
9 What will be the outgut of the C program Aincluderstdich.pdf9 What will be the outgut of the C program Aincluderstdich.pdf
9 What will be the outgut of the C program Aincluderstdich.pdfsastaindin
 
9 Which Git command should be used to update a local reposi.pdf
9 Which Git command should be used to update a local reposi.pdf9 Which Git command should be used to update a local reposi.pdf
9 Which Git command should be used to update a local reposi.pdfsastaindin
 
9 Private solutions to correct for externalities Consider t.pdf
9 Private solutions to correct for externalities Consider t.pdf9 Private solutions to correct for externalities Consider t.pdf
9 Private solutions to correct for externalities Consider t.pdfsastaindin
 

Mehr von sastaindin (20)

A 7 year 15000 bond paying a coupon rate of 475 compound.pdf
A 7 year 15000 bond paying a coupon rate of 475 compound.pdfA 7 year 15000 bond paying a coupon rate of 475 compound.pdf
A 7 year 15000 bond paying a coupon rate of 475 compound.pdf
 
A 25 yearold graduate student enters the student health ce.pdf
A 25 yearold graduate student enters the student health ce.pdfA 25 yearold graduate student enters the student health ce.pdf
A 25 yearold graduate student enters the student health ce.pdf
 
a 2 pts Construct the final Fibonacci heap after the fol.pdf
a 2 pts Construct the final Fibonacci heap after the fol.pdfa 2 pts Construct the final Fibonacci heap after the fol.pdf
a 2 pts Construct the final Fibonacci heap after the fol.pdf
 
A 2010 Pew Research poll asked 1306 Americans From what yo.pdf
A 2010 Pew Research poll asked 1306 Americans From what yo.pdfA 2010 Pew Research poll asked 1306 Americans From what yo.pdf
A 2010 Pew Research poll asked 1306 Americans From what yo.pdf
 
a 1 The first step is to understand the requirements of th.pdf
a 1 The first step is to understand the requirements of th.pdfa 1 The first step is to understand the requirements of th.pdf
a 1 The first step is to understand the requirements of th.pdf
 
A 10 year old develops severe pharyngitis at summer camp He.pdf
A 10 year old develops severe pharyngitis at summer camp He.pdfA 10 year old develops severe pharyngitis at summer camp He.pdf
A 10 year old develops severe pharyngitis at summer camp He.pdf
 
A modeling study of the stomatogastric ganglion STG of th.pdf
A  modeling study of the stomatogastric ganglion STG of th.pdfA  modeling study of the stomatogastric ganglion STG of th.pdf
A modeling study of the stomatogastric ganglion STG of th.pdf
 
9 Using the key choices complete the crossword puzale by a.pdf
9 Using the key choices complete the crossword puzale by a.pdf9 Using the key choices complete the crossword puzale by a.pdf
9 Using the key choices complete the crossword puzale by a.pdf
 
9 Sickle Cell Anemia is a condition that shows codominance.pdf
9 Sickle Cell Anemia is a condition that shows codominance.pdf9 Sickle Cell Anemia is a condition that shows codominance.pdf
9 Sickle Cell Anemia is a condition that shows codominance.pdf
 
A Blastula aamas B zigot aamas C Morula aamas D.pdf
A  Blastula aamas   B  zigot aamas   C  Morula aamas   D.pdfA  Blastula aamas   B  zigot aamas   C  Morula aamas   D.pdf
A Blastula aamas B zigot aamas C Morula aamas D.pdf
 
97 Using the table for the t distributions make an assess.pdf
97 Using the table for the t distributions make an assess.pdf97 Using the table for the t distributions make an assess.pdf
97 Using the table for the t distributions make an assess.pdf
 
925 Match the following generally accepted accounting princ.pdf
925 Match the following generally accepted accounting princ.pdf925 Match the following generally accepted accounting princ.pdf
925 Match the following generally accepted accounting princ.pdf
 
8En Alemania los trabajadores Seleccione uno a pued.pdf
8En Alemania los trabajadores    Seleccione uno  a pued.pdf8En Alemania los trabajadores    Seleccione uno  a pued.pdf
8En Alemania los trabajadores Seleccione uno a pued.pdf
 
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
 
918 LAB Sorting user IDs Given a main that reads user ID.pdf
918 LAB Sorting user IDs Given a main that reads user ID.pdf918 LAB Sorting user IDs Given a main that reads user ID.pdf
918 LAB Sorting user IDs Given a main that reads user ID.pdf
 
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
 
9 You are studying the molecular behavior of myosin II S1 .pdf
9 You are studying the molecular behavior of myosin II S1 .pdf9 You are studying the molecular behavior of myosin II S1 .pdf
9 You are studying the molecular behavior of myosin II S1 .pdf
 
9 What will be the outgut of the C program Aincluderstdich.pdf
9 What will be the outgut of the C program Aincluderstdich.pdf9 What will be the outgut of the C program Aincluderstdich.pdf
9 What will be the outgut of the C program Aincluderstdich.pdf
 
9 Which Git command should be used to update a local reposi.pdf
9 Which Git command should be used to update a local reposi.pdf9 Which Git command should be used to update a local reposi.pdf
9 Which Git command should be used to update a local reposi.pdf
 
9 Private solutions to correct for externalities Consider t.pdf
9 Private solutions to correct for externalities Consider t.pdf9 Private solutions to correct for externalities Consider t.pdf
9 Private solutions to correct for externalities Consider t.pdf
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 

Kürzlich hochgeladen (20)

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 

98 LAB Word Count Weite a program that first reads in the .pdf

  • 1. 9.8 LAB: Word Count Weite a program that first reads in the raime of an inout file and then reada the file sing the cov readed0 method The fik contains mit ple lines : each a comma segarated list of words. The program must outeut the words and theit frequehbies tive number of tenes eoch wers appeats in the fila) witheut any duplicates and daregarcing case (output the words in lower case) Why do this? in case you are wondenng wry it woudd be important to calcubete bow many times a word oceurted a a documxent. this is a ocnoept known as ferm trequency and is a concept oftien used in information ietreval in fact, one of the ear lent papers related to Big Daia discusaes how Google did word count but at a much latger scide - they were doing t across alt of the documents they had crawicd in bulding thes search inder. Example: If theinput is cintoniesy and the contents of Cintor eav consusted of the folowing 4 knes If, there, is, one, needage, that, echees, forth, fren, thia, conference let, it, be, tkat, humss, rhahti, are, ,youne's, at rights, and, wocen'a, righti aro, hueian, rtabtin, ence, and, for, akl, Wet, wes, not, fotget, that, ansed the outhut is if -1 chere - 1 ts- 1 one-1 tesaage - 1 that -3 achoes - 1 forte -1tran--1thin1obaferuace-11it=21t1 be=2himan4fightn5are=dmonea2and=3iopce=1fer-1a.11-1iu=1inot=1furget:=1afope=1those=1the 3ituht=2to-2apeai=1freely=1hisard1 Notes: - The curient versian of Python stares dictionary entries in the order in which dects were mserted - The itenat) method retums all of the keyvalue pair entries from a dectonary and can be comerted to a lat. For esample if a dictionary was named myydict, a ast (inorder) of af of the entries can be gensrated by caling 1 ist ( my_diec.itena () ). Each item in the list would be a tuple wth the key and value for an entiy: - Similarly sst(nyydetkeys0) will generate a liat of the keys (in ordes)- The cument version of Python stores dictionary entries in the order in which items were ingerted - The items () method relurns all of the keyvalue pair entriea from a dictionary and can be corverted to a fat. For example, if a dictionary was named my_dict, a lst (in ordet) of all of the entries can be generated by calling 1i=1 fy diet. items() ). Each item in the list would be a taple with the key and value for an entry. - Similathy. list my, idict keys0) will generate a jst of the keys (in order). - Output words in oeder of their first occurfence in the fili - The file Clintoncsv is available to download