UECM1534: The file “Sports Sales.csv” contains data on the sales of products by sports companies around the world. Write a Python script that performs the following tasks in the given order: Programming Techniques for Data Processing Assignment, NUM, Malaysia
University | The National University of Malaysia (NUM) |
Subject | UECM1534: Programming Techniques for Data Processing |
Question 1
The file “Sports Sales.csv” contains data on the sales of products by sports companies around the world. Write a Python script that performs the following tasks in the given order. If you are using Jupyter Notebook, your script must be self-contained in a single code cell. That is, all the given tasks are performed without any error or warning when your script is run once from a single code cell. The tasks are:
- Read the dataset into a DataFrame called df. Then, display the first 5 rows of the dataset.
- Print out the number of records in the dataset and the total number of missing values.
- Remove the records where the Date, Customer ID, Customer Gender, Country, or Product Category fields have missing data. Save the result in a DataFrame called df_cleaned. Print out the total number of records removed this way.
- Fill in the remaining missing data in the fields of df_cleaned with the mean of the field. Print out the total number of values filled this way.
- Convert the column “Date” of df_cleaned to DateTime datatype (assume that the dates are day first). Then, set the column “Date” as the index and sort these dates in descending order.
- Convert the datatype of the numeric columns in df_cleaned to integer datatype. Note that the numbers should be rounded to the nearest integer after the conversion. Print out the data types of all the columns for confirmation.
- Add columns “Year” and “Quarter” to df_cleaned, where the column “Year” contains the year of the date in the index, and the column “Quarter” contains the quarter of the year of the date in the index. Then, display the first 5 rows of the dataset.
- Using df_cleaned, create a DataFrame called df_customers that keeps 5 sums –Order Quantity, Unit Cost, Unit Price, Cost, Revenue, and Profit — for each customer. Note that each customer is identified by his or her unique Customer ID. Then, sort the dataset by Revenue in descending order. Then, display the first 5 rows of the dataset.
- Using df_cleaned, create a dictionary called df_countries that keeps the unique
values in the column “Country” as its keys and keeps the dataset for each country as its values. For example, df_countries[“United States”] should reference the DataFrame containing the data for only the United States. The column “Country” should be dropped from this DataFrame. You should test this and display the resulting DataFrame. Extra marks will be given for automation.
Are You Searching Answer of this Question? Request Malaysian Writers to Write a plagiarism Free Copy for You.
Question 2
The file “Survey.csv” is a dataset that contains the results of a survey on social media users. The questions ask about:
- the background (demographics) of the respondent,
- the types of social media that are consumed by the respondent, and
- the types of issues that the respondent takes interest in on social media.
Each column (except the first) in the dataset corresponds to a question in the survey. The questions are given in row 8 and the category of the questions in row 7. From row 9 onward, each row in the dataset corresponds to a respondent of the survey. The possible answers to each question in the survey are given in the top rows, that is, from row 1 up to row 6. In addition, the types of issues that the respondents are asked about are categorized into: - national issues, and
- local issues.
In particular, the columns “Living Costs” up to “NationalOthers” belong to national issues, and the columns “Land” up to “LocalOther” belong to local issues.
Get Solution of this Assessment. Hire Experts to solve this assignment for you Before Deadline.
Get Help By Expert
Grab our best programming assignment help to complete your UECM1534: Programming Techniques for Data Processing assignment. Malaysia Assignment Help has a team of academic writers who serve the 100% plagiarism-free solution of essay writing, report writing, dissertation writing, research paper, etc at a low price.

Recent Solved Questions
- When they come into force the provisions of the Environment Bill 2019-2021 will give real substance to the Government: Environmental Law Assignment, TUL, Malaysia
- MKT243: Developing economies suffer from a lack of market dynamism and competitive firm selection: Fundamentals of Marketing Assignment, UiTM, Malaysia
- Ability to use Proteus Simulation Software to simulate electric circuits and measure electrical quantities: Electronic Assignment, MMU, Malaysia
- Challenges For The Tourism Businesses During The Pandemic In Tioman Island Malaysia: Business and Management Dissertation Proposal, UTAR, Malaysia
- DUE10012: Many people have the mindset that everything revolves around money Having a lot of money, after all, leads to greater spending power which can satisfy one’s impulses: Communicative English 1 Essay, PM, Malaysia
- TMF1414: Your task is to develop a room reservation system for My Vacation Hotel The room tariff for this hotel is given in the table below: Programming Assignment, UNIMAS, Malaysia
- In this assignment, your team is asked to develop a store management system (SMS) in Java using Eclipse IDE and object-oriented programming concepts: Object Orientation Programming Assignment, UUM, Malaysia
- You and your group member own a cookies business where you make delicious brownies cookies with various flavors: Principle of Marketing Assignment, UUM, Malaysia
- WUC107/03: You are a Malaysian trainer who is a highly sought-out expert in the area of cross-cultural negotiations The Communications Director of a large company has asked you to write an article on ‘Guidelines for cross-cultural negotiations in China’ for their business magazine: Workplace Communication Skills Assignment, UOW, Malaysia
- You are opening a new trendy pizza shop where customers can buy, not only circular pizza, but also square and hexagonal pizzas: Computer Programming, Assignment, TU, Malaysia