Run the following code to create a dataframe object dr and assign a dataset which contains...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Run the following code to create a dataframe object dr and assign a dataset which contains the sales achievement of the salemen in different stores. Then write code to complete the tasks below. Store Code Stuff a S1000) Mary Als Mi .. Jimmy 14 Leo 20 Anport pandas as pd inport numpy as df pd.Datafrane (data-ap.array((('B', 'Hary', 101, ('A', 'Peter',201, ('A', 'Ada'1.', 'ike1.1'A', 'Jimmy,16). C, Leo',7}}}\ columns= ('Store Code', 'Staff Hama', 'Bales Achievement (in $1000) 1) Store Code Staff Hans Bales Achievement (in 61000) Mary Peter Ada Mike A A A 0 Jimmy Loo 10 20 6 8 16 E4.1 Retrieve the column of "Staff Name' E4.2 Retrieve the columns of "Staff Name" and "Sales Achievement (in $1000)" 54.3 (5 points) Use loc and label-based index to Retrieve the sales achievement of Peter, Mike and Jimmy. E4.4 Use lloc and Interger-based index to retrieve the same information as required in E4.3. E4.5 Get all the records associated with Department A. Hint: Use boolean mask and loc operator. + Code + Text Run the following code to create a dataframe object dr and assign a dataset which contains the sales achievement of the salemen in different stores. Then write code to complete the tasks below. Store Code Stuff a S1000) Mary Als Mi .. Jimmy 14 Leo 20 Anport pandas as pd inport numpy as df pd.Datafrane (data-ap.array((('B', 'Hary', 101, ('A', 'Peter',201, ('A', 'Ada'1.', 'ike1.1'A', 'Jimmy,16). C, Leo',7}}}\ columns= ('Store Code', 'Staff Hama', 'Bales Achievement (in $1000) 1) Store Code Staff Hans Bales Achievement (in 61000) Mary Peter Ada Mike A A A 0 Jimmy Loo 10 20 6 8 16 E4.1 Retrieve the column of "Staff Name' E4.2 Retrieve the columns of "Staff Name" and "Sales Achievement (in $1000)" 54.3 (5 points) Use loc and label-based index to Retrieve the sales achievement of Peter, Mike and Jimmy. E4.4 Use lloc and Interger-based index to retrieve the same information as required in E4.3. E4.5 Get all the records associated with Department A. Hint: Use boolean mask and loc operator. + Code + Text
Expert Answer:
Answer rating: 100% (QA)
It seems like there are some errors in the provided code for creating the DataFrame Let me correct t... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Note: R Is The Last Digit Of The Student Registration Number. (Second Last Digit, If The Last Digit Is Zero) 1) (20) Value Of The Portfolio Today Is $100. Annual Mean U = 20%, Variance O2 = 10%. Time...
-
Different Types Of Nervous System Are Involved In Neural Regulation, Including Somatic Motor, Somatic Sensory, Autonomic Sympathetic, And Autonomic Parasympathetic Nervous Systems. Describe One Organ...
-
Ella, a portfolio manager, considered several ways to invest USD15 million for one year. The data are as follows: USD interest: 7% per annum (p.a.) GBP interest: 10% p.a. Spot exchange rate:...
-
Ames Manufacturing Plant produces two different replacement parts for dishwashers. During a normal shift, they have 7 hours of time available on their main fabrication machine. The machine will...
-
A category-3 hurricane on the Saffir-Simpson scale (www.encyclopedia.com) has a maximum velocity of 130 mi/h. Let the match-point radius be R = 18 km (see Fig. P8.14) Assuming sea-level standard...
-
Einstein's Special Theory of Relativity says that an object's mass in is related to its velocity v by the formula Here m0 is the rest mass and c is the speed of light. Use differentials to determine...
-
A vapour absorption system has a source temperature of 110C, the refrigeration temperature of 5C, and ambient temperature of 35C. Calculate its COP.
-
You are auditing Riverview Medical Center for its fiscal year ending December 31, 2010. During your tests of account balances you noted the following: 1. The November revenue journal indicates that...
-
X, a designer, seeks your advice on the following: a) X has worked as a freelance graphic artist for Y Ltd for several years. His artwork for Y Ltd features a cartoon image of a humorous,...
-
Two identical particles, each having charge #q, are fixed in space and separated by a distance d. A third point charge -Q is free to move and lies initially at rest on the perpendicular bisector of...
-
Mila and her best friend Leon, both aged 35, are always on the lookout for a good business opportunity. Their first joint venture, called New Work ('NW'), involves leasing commercial property in...
-
Zane Corporation was a mediumsized company with multiple product lines. More than 20 years ago, Zane implemented project management to be used in all their product lines, but mainly for operational...
-
Develop a hypothesis about the use of culture in creating a customer-brand relationship. How does the firm's product and communication strategy support the brand in the global market and why....
-
Determine what changed objectives or newly implemented interventions are required to improve apple position within its market.
-
Sitting in his office, Mark Ellinas frowned at his computer screen. It was filled with row after row of electric bikes, from expensive models to cheap knockoffs that seemed held together by spit and...
-
Importance of a Concept. A widely held assumptionin anthropology, linguistics, and communication is that the importance of a concept to a culture can be measured by the number of words the language...
-
From a group of 6 people, you randomly select 4 of them. What is the probability that they are the 4 oldest people in the group? Give your answer as a fraction
-
a. Show that the expansion of q(x) in ascending powers of x can be approximated to 10 2x + Bx 2 + Cx 3 where B and C are constants to be found. b. Find the percentage error made in using the series...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-4. Ivan and Irene paid the following in 2012 (all by check or can otherwise be...
-
Kathy Kennedy (age 44) is a single taxpayer and she lives at 212 North Pine Way, Payson, AZ 85541. Her Social Security number is 467-98-9784. Kathy's earnings and income tax withholding as the...
-
Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is...
-
A football is thrown on a long pass. Compared to the balls initial vertical velocity, the vertical component of its velocity at the highest point is (a) greater, (b) less, (c) the same.
-
Which one of the following cannot be a true statement about an object: (a) It has zero velocity and a nonzero acceleration; (b) it has velocity in the x-direction and acceleration in the y-direction;...
-
Two linear vectors of magnitudes 3 and 4 are added. The magnitude of the resultant vector is (a) 1, (b) 7, (c) between 1 and
Study smarter with the SolutionInn App