Your Turn

In this chapter, you looked at how to extract data from local disk files and the Internet, store them into appropriate data structures, extract bits and pieces matching certain patterns, and pickle for future processing. There is nothing infinite in computer science, but there is an infinite number of scenarios requiring data extraction, broadly ranging in type, purpose, and complexity. Here are just some of them.

Word Frequency Counter*

Write a program that downloads a web page requested by the user and reports up to ten most frequently used words. The program should treat all words as case-insensitive. For the purpose of this exercise, assume that a word is described by the regular expression r"\w+".

File Indexer**

Write a program ...

Get Data Science Essentials in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.