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|
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.
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 is 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
- As a newly hired Chief Social Media Manager for the head office of an international organisation: BM004-3-1 BCS Business Communication Report, APU, Malaysia
- you need to draw on leadership and management theories to demonstrate understanding and application of the module content of “Management, Leadership, Vision/Mission/Strategy: Professional Management and Leadership Assignment, OUM, Malaysia
- CBSE4103: A local bank intends to install a new Automated Teller Machine to allow bank customers to perform basic financial transactions: SOFTWARE ENGINEERING Assignment, OUM, Malaysia
- What is the purpose of the statistical test & E.g. the purpose of regression analysis is to estimate the relationship: Cyhoeddus Research Paper, UON, Malaysia
- In view of relevant case-law and academic opinion, critically examine to what extent the rise of AI may be a good opportunity: Intellectual Property Law Course Work, UiTM, Malaysia
- TBE 101/03: Metals are commonly employed in the building and construction industry due to their inherent qualities: Building Materials Report, WOU, Malaysia
- Explain the term Explicit and Implicit costs. Give examples. What is Economic Profit as compared to Financial Profit: Managerial Economics Assignment, UON, Malaysia
- Batik Gerimis was formed by Che Mahadi and their wife in 1997 after lengthy and laborious work to learn skills in batik: Data Analytics Assignment, HWU, Malaysia
- BBF305/03: Evaluate the three mutual funds using Sharpe and Treynor measure and Given the risk-free rate is 5%: Investment and Portfolio Management Assignment, WOU, Malaysia
- DCP5101: I need a standalone console application that can keep track of my restaurant sales. Customers will typically order food and drinks: Program Design Assignment, MMU, Malaysia