1. Homepage
  2. Programming
  3. DSCI 510: Principles of Programming for Data Science - Lab 9 Assignment: Counting Occurrences

DSCI 510: Principles of Programming for Data Science - Lab 9 Assignment: Counting Occurrences

Engage in a Conversation
USCDSCI 510Principles of Programming for Data ScienceCounting OccurrencesWeb ScrappingPython

DSCI 510: Principles of Programming for Data Science CourseNana.COM

Fall 2023
Lab 9 Assignment
Due: 10/24/2023 11:59 PM PT CourseNana.COM

Assignment Link - https://classroom.github.com/a/r-cJHAl8
Assignment Overview
This assignment expects you to write two python functions using provided starter code. Deliverable: CourseNana.COM

A python file named: run.py CourseNana.COM

1. Counting Occurrences. [15 points] CourseNana.COM

For this question, we will be using requests library to make web-pages behave like files. We have a webpage that displays an extract from the famous play Romeo and Juliet. As we know, Shakespeare loved using some words like "thou", "thy", "thee", "O" etc, we want to calculate the frequency of these words in the selected extract from the web-page http://data.pr4e.org/romeo- full.txt CourseNana.COM

Function: get_frequency
Argument: (str) url, (str)word_to_search Return: (int) count CourseNana.COM

Example:
Input-
url = http://data.pr4e.org/romeo-full.txt word_to_search= “thou”
Output -
32 CourseNana.COM

CourseNana.COM

2. Web Scrapping [15 points]
For this question, we will be using beautiful soup to Scrap Table of Contents from a Wiki page. CourseNana.COM

Given a wikipedia article, CourseNana.COM

https://en.wikipedia.org/wiki/List_of_spaceflight_launches_in_January%E2%80%93June_2023 CourseNana.COM

We want to identify all operators and their counts for the given outcome(successful/operational) spaceflight launches between January 2023 to June 2023. CourseNana.COM

Consider both the tables from the website - Orbital launches and Suborbital flights A pseudo code to web scrape this information is given in run.py for your reference. CourseNana.COM

Function: get_contents_from_web Arguments: (str) url, (str)outcome Return: (dict) operator_dict CourseNana.COM

Example: CourseNana.COM

Input - CourseNana.COM

url = CourseNana.COM

https://en.wikipedia.org/wiki/List_of_spaceflight_launches_in_January%E2%80%93June_2023 CourseNana.COM

outcome= “successful” Output -
{
CourseNana.COM

"AFGSC":1,
"Antaris Space":1,
"CU Boulder":1, "Clemson University":2, ...
....
.....
CourseNana.COM

CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
USC代写,DSCI 510代写,Principles of Programming for Data Science代写,Counting Occurrences代写,Web Scrapping代写,Python代写,USC代编,DSCI 510代编,Principles of Programming for Data Science代编,Counting Occurrences代编,Web Scrapping代编,Python代编,USC代考,DSCI 510代考,Principles of Programming for Data Science代考,Counting Occurrences代考,Web Scrapping代考,Python代考,USChelp,DSCI 510help,Principles of Programming for Data Sciencehelp,Counting Occurrenceshelp,Web Scrappinghelp,Pythonhelp,USC作业代写,DSCI 510作业代写,Principles of Programming for Data Science作业代写,Counting Occurrences作业代写,Web Scrapping作业代写,Python作业代写,USC编程代写,DSCI 510编程代写,Principles of Programming for Data Science编程代写,Counting Occurrences编程代写,Web Scrapping编程代写,Python编程代写,USCprogramming help,DSCI 510programming help,Principles of Programming for Data Scienceprogramming help,Counting Occurrencesprogramming help,Web Scrappingprogramming help,Pythonprogramming help,USCassignment help,DSCI 510assignment help,Principles of Programming for Data Scienceassignment help,Counting Occurrencesassignment help,Web Scrappingassignment help,Pythonassignment help,USCsolution,DSCI 510solution,Principles of Programming for Data Sciencesolution,Counting Occurrencessolution,Web Scrappingsolution,Pythonsolution,