Catz Oracle Redwood City 5324 No previous year 095 5227 002 362 5324e07 3

Catz oracle redwood city 5324 no previous year 095

This preview shows page 20 - 24 out of 30 pages.

Catz* Oracle (Redwood City) $53.24 (No previous year) $0.95 $52.27 $0.02 362 5.324e+07 3 Robert A. Iger Walt Disney (Burbank) $44.91 -3% $24.89 $17.28 $2.74 477 4.491e+07 4 Marissa A. Mayer Yahoo! (Sunnyvale) $35.98 -15% $1.00 $34.43 $0.55 342 3.598e+07 5 Marc Benio ff salesforce.com (San Francisco) $33.36 -16% $4.65 $27.26 $1.45 338 3.336e+07 6 John H. Hammergren McKesson (San Francisco) $24.84 -4% $12.10 $12.37 $0.37 222 2.484e+07 7 John S. Watson Chevron (San Ramon) $22.04 -15% $4.31 $14.68 $3.05 183 2.204e+07 8 Je ff rey Weiner LinkedIn (Mountain View) $19.86 27% $2.47 $17.26 $0.13 182 1.986e+07 9 John T. Chambers** Cisco Systems (San Jose) $19.62 19% $5.10 $14.51 $0.01 170 1.962e+07 10 John G. Stumpf Wells Fargo (San Francisco) $19.32 -10% $6.80 $12.50 $0.02 256 1.932e+07 ... (92 rows omitted) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Running tests -------------------------------------------------------------------- - Test summary Passed: 2 Failed: 0 [ooooooooook] 100.0% passed
Image of page 20
2/10/19, 11(12 PM lab04 Page 21 of 30 Now that we have all the pays as numbers, we can learn more about them through computation. Question 3.3. Compute the average total pay of the CEOs in the dataset. In [44]: average_total_pay = np . average(compensation . column( "Total Pay ($)" )) # SOLUTION average_total_pay In [45]: _ = ok . grade( 'q3_3' ) Question 3.4. Companies pay executives in a variety of ways: in cash, by granting stock or other equity in the company, or with ancillary benefits (like private jets). Compute the proportion of each CEO's pay that was cash. (Your answer should be an array of numbers, one for each CEO in the dataset.) Note: When you answer this question, you'll encounter a red box appearing below your code cell that says something like RuntimeWarning: invalid value encountered in true_divide . Don't worry too much about the message. Warnings are raised by Python when it encounters an unusual condition in your code, but the condition is not severe enough to warrant throwing an error. The warning below is Python's cryptic way of telling you that you're dividng a number by zero. If you extract the values in Total Pay ($) as an array, you'll see that the last element is 0. Out[44]: 11445294.11764706 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Running tests -------------------------------------------------------------------- - Test summary Passed: 1 Failed: 0 [ooooooooook] 100.0% passed
Image of page 21
2/10/19, 11(12 PM lab04 Page 22 of 30 In [46]: cash_proportion = compensation . apply(convert_pay_string_to_number, "Ca sh Pay" ) / compensation . column( "Total Pay ($)" ) #SOLUTION cash_proportion In [47]: _ = ok . grade( 'q3_4' ) /srv/app/venv/lib/python3.6/site-packages/ipykernel_launcher.py:1: R untimeWarning: invalid value encountered in true_divide """Entry point for launching an IPython kernel. Out[46]: array([0.01784038, 0.01784373, 0.55421955, 0.02779322, 0.13938849, 0.48711755, 0.19555354, 0.12437059, 0.25993884, 0.35196687, 0.3075693 , 0.22138635, 0.13126362, 0.1708126 , 0.23099415, 0.06734817, 0.13043478, 0.28004957, 0.33229814, 0.15355805, 0.29337748, 0.21829105, 0.31100478, 0.25086147, 0.2299169 , 0.16991643, 0.31795947, 0.26188786, 0.28357143, 0.15654718, 0.38168558, 0.28934426, 0.20361248, 0.47650453, 0.45643154, 0.36402027, 0.2177626 , 0.24763543, 0.42562724, 0.2610261 , 0.18361836, 0.1444548 , 0.33333333, 0.10834132, 0.20925747, 0.97276265, 0.22979552, 0.22789784, 0.37893701, 0.25175527, 0.73895582, 0.37018256, 0.2412731 , 0.2133758 , 0.20553781, 0.23318872, 0.33664459, 0.3875969 , 0.56094808, 0.11757991, 0.35239207, 0.24463007, 0.25 , 0.23712575, 0.43377886, 0.31424936, 0.46363636, 0.32585752, 0.24766977, 0.98755187, 0.27184466, 0.96207865, 0.31831395, 0.81979321, 0.23795181, 0.17530488, 0.21172638, 0.37162162, 0.27288136, 0.26994907, 0.55148342, 0.3597786 , 0. , 0.47154472, 0.47154472, 0.29753915, 0.16235294, 0.48529412, 0.46819338, 0.32526882, 0.98958333, 0.61130742, 0.67021277, 0.75510204, 0.50837989, 0.98809524, 0.98039216, 0.9893617 , 0.87654321, 0. , 1. , nan]) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Running tests -------------------------------------------------------------------- - Test summary Passed: 2 Failed: 0 [ooooooooook] 100.0% passed
Image of page 22
2/10/19, 11(12 PM lab04 Page 23 of 30 Check out the % Change column in compensation . It shows the percentage increase in the CEO's pay from the previous year. For CEOs with no previous year on record, it instead says "(No previous year)". The values in this column are strings , not numbers, so like the Total Pay column, it's not usable without a bit of extra work.
Image of page 23
Image of page 24

You've reached the end of your free preview.

Want to read all 30 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture