Python代写-ALY6140-Assignment 2
时间:2022-03-06
ALY6140: Analytics Systems Technology Assignment 2 Winter B 2022
1

The assignment section for Week 2 contains:
• an example txt file
• an example csv file
• an example excel file
• an example json file
• an example html file
• an example SQLite database file
• and, finally, a template_utility.py (Python) file--this should serve as your starting
template to complete the requirements of the assignment.


The Week 2 Assignment requires you to write a python script to import each of the example
files. The Python script should follow the format of the template_utility.py example.
Specifically, for each of the example files (txt, csv, excel, SQLite database, json, html) write
a separate function for each file type that, when given the file as an argument, imports the
data from that file (that is, reads the file in) and assigns it to an appropriate Python data
structure (like an array, or a data frame, etc.) and returns that data structure.

In the Jupyter Notebook file,
1. Import functions defined in A2_utility_firstname_lastname.py

2. Test each function with corresponding file: once get the returned data from calling
each function, please do the following accordingly:

• For txt file → show the shape (number of rows and columns) and the 6th record from the
end

• For csv file → show last 10 records

• For excel file → show the shape (number of rows and columns) and the 5th record

• For html file → find the number of paragraphs

and find the number of paragraphs
contains the string "gravitational wave" omitting the cases.

• For json file → find the number of records in the json file, show last 3 records, and find
out the number of null values in column ‘mass’.

• For SQLite database file → find out which customer has the 2nd most accumulated
spending and show CustomerId, the name of the customer, BillingCountry, and total
spending (Hint: One customer might have multiple transactions. Using table customers &
invoices )

ALY6140: Analytics Systems Technology Assignment 2 Winter B 2022
2

Please define above functions in a script file(.py), then import this utility file in a Jupyter
Notebook file(.ipynb) and verify/demonstrate the results.


Please make sure to:

• Properly document the functions

• Properly assign arguments to the functions

• Properly return a data structure from each function

• Avoid excessive printing

• Submit a proper Python script file (A2_utility_firstname_lastname.py) and a Jupyter
Notebook file (A2_test_firstname_lastname.ipynb) as your answer to the assignment

essay、essay代写