You are on page 1of 1

BDS Programming for Analytics – HW 3

10 Marks

Q1) The file Emp_Salary.xls has the salary and Emp Id of 20 employees. The tax
computation is as mentioned below

 For Salary < = 10,000 tax rate = 5% flat rate


 For Salary > 10,000 and <= 25000 tax rate = 7 % flat rate
 For Salary > 25000 tax rate = 8% flat rate

Write python code to perform the below (5 Marks)

 Read the file “Emp_Salary.xls” as dataframe


 Define a function to compute the taxable amount for a given salary
 Use Apply / Lambda functions to create a new column called “tax” for the data
frame
 Create an addition column Net_Salary = Salary – Tax
 Show first 5 rows of the dataframe
 Write out the file as “Tax_computed.csv”

Q2) Consider the Data Set – Product_Sales.CSV Which contains Sales Information about
certain products in cities in Australia for a large Retail Store. The VP of Sales wants to
know the following : (See below)
Write python code to analyze the data and answer the below questions . (5 Marks)

1) What is the highest selling product category in terms of Monetary?


2) Which Product category sells more in Sydney?
3) Which City has the highest Sales for Healthcare
4) Which Month had the highest sale for Sporting goods ?
5) Where does healthcare sale more?

You might also like