ICT702 Data Wrangling - Task 2 - Python Assignment Help

Ticket Ordering System

In this first part of Task 2, you should write a Python script for the ticket ordering system. Your program must ask the relevant questions of the customer, calculate the total costs, print the tickets, and also store a one-line summary of the transaction into a CSV file for future sales analysis.

Specifically, the program should do the following:

• At the start, the program should get the number of required tickets from the customer, plus the choice of movie and session time. The available movies and session times for the current day, plus the pricing data, will be available in a file sessions.csv.
• Secondly the program should ask the customer how many adult tickets and how many discount tickets they require. (This step can be skipped if the movie session is for a family movie, since all prices are equal).
• Thirdly, the program should take popcorn orders from the customer, asking for the number of small and large buckets of popcorn. These are priced at $5 and $10, respectively.
• The program should then print the whole order summary, with the prices of each item, and the total price at the bottom.
• Customer payment will be done by a separate PayWave machine. The interface to this is a simple function call, request_payment(amount), which will return True if the payment was successful, False otherwise. For the purposes of this assignment, you should use the following implementation of this function, where payments fail around 20% of the time. Note: you should import the 'time' and 'random' libraries at the top of your program.
• If the payment was successful, the program should print one movie ticket for the whole group of customers, showing all the same details as the order summary, plus the cinema number.
• Finally, if the payment was successful, then the program should log all of the data into a file called sales.csv, with just one line for the whole transaction. A sample sales.csv output file is available on Blackboard.


• You must use standard Python data structures, not Pandas, to store the prices of the individual items.
• Movie names, session times and price details are available in sessions.csv, which can be found on Blackboard.
• Your program should produce its log file in the same output format as the sample sales.csv output file that is available on Blackboard.
• HINT: You should use the Python “input(message)” function to read each input value from the customer (for example when asking for the number of tickets or the choice of movie).

Ticket Sales Analysis

In this second part of Task 2, you must write a Jupyter notebook that reads and analyses several ticket sales data files (sales_CinemaName.csv) from different cinemas in the ScaryMovies Cinema chain. Each of these data files contains several weeks of ticket sales data.

You should produce at least FOUR useful graphs that give insight into the ticket sales trends.

For example, here are some suggestions:

A. plot the total number of tickets sold per day, over the time period in the data file? This will allow you to see increasing or decreasing sales trends.
B. graph the total number of tickets sold by each cinema?
C. graph a break-down of the total ticket sales by the movie ratings?
D. graph a break-down of the total ticket sales by the session types?
E. graph the total weekly takings (total sales) of the cinema?
F. graph just the popcorn sales of the cinema?
G. graph the popularity of different session times or periods during the day, such as morning, afternoon, evening? (You might also like do this graph separately for each session type: Family, Normal, 3D?)
H. graph the frequency of each movie (i.e. movie name), so you can see which movies are the most popular and least popular?

For each of these suggestions, you might start by graphing it for a single cinema, and then extend your program to graph it for all the cinemas in the chain so that you can compare them against each other.


• You must have at least one graph comparing the takings (in dollars) across the different cinemas in the chain.
• You should use the Pandas library to store and manipulate the data.
• Use markup and headings to break your Jupyter notebook into sections and give commentary about what you doing, and discussion of your results. This Jupyter notebook will be what you submit, plus your Report will have your overall discussion and conclusions, showing just a few of the most interesting graphs from your Jupyter notebook.

3 What you will submit

There are three deliverables in two parts.

Part A is due Friday in week 9.  You will submit:

• Python code for the ordering system in a Jupyter notebook file.

Part B is due Friday in Week 13. You will submit:

1. Python code for the trends analysis in a Jupyter notebook file;
2. Report to the cinema client based on your analysis (PDF or word doc).

Order Now