# -*- coding: utf-8 -*- IR IR I # note: do not import other packages; my test script uses only these import numpy as np

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

# -*- coding: utf-8 -*- IR IR I # note: do not import other packages; my test script uses only these import numpy as np

Post by answerhappygod »

Coding Utf 8 Ir Ir I Note Do Not Import Other Packages My Test Script Uses Only These Import Numpy As Np 1
Coding Utf 8 Ir Ir I Note Do Not Import Other Packages My Test Script Uses Only These Import Numpy As Np 1 (56.06 KiB) Viewed 54 times
# -*- coding: utf-8 -*- IR IR I # note: do not import other packages; my test script uses only these import numpy as np import pandas as pd # allow output to span multiple output lines in the console pd.set_option('display.max_columns', 500) # # # read the data # df = pd.read_csv("https://raw.githubusercontent.com/fivet ... -grads.csv") = # # # series # # let's start with two series # (without the copy, we are just getting a view of a column, # and it will cause problems later, for example in sorting) unemp = df['Unemployment_rate'].copy major = df['Major'].copy) = #@ @ # Compute the number of majors associated with each major # category. The first lines of your result should look like this: # Engineering 29 # Education 16 # Humanities & Liberal Arts 15 # Biology & Life Science 14 # #@ # Add a new variable 'HighShareWomen' to the data frame. # This variable should be True if ShareWomen > 0.50, and # False otherwise. Then compute the first five values in . # the HishShareWoman column. ############################################################### # In the remaining problems you can assume that df additionally # contains the column 'HighShareWomen' ############################################################### #@ # Compute the fraction of majors that have a high share of women. # Your result should be a number close to 0.56 #@ # For each major, compute the fraction of those working in # low-end jobs. Show the 10 majors with the most low wage # jobs, ordered by decreasing fraction of low-end jobs. # Your result should be a series that begins like this: # Major # COSMETOLOGY SERVICES AND CULINARY ARTS 0.300951 # DRAMA AND THEATER ARTS 0.255913 # MISCELLANEOUS FINE ARTS 0.226048 # CLINICAL PSYCHOLOGY 0.219168 # STUDIO ARTS 0.211227 #@ # For each major category, compute the maximum of the median # salaries for majors within that category. Sort by decreasing # # median salary. # Your result should be a series that begins like this: # Major_category # Engineering 110000 # Physical Sciences 62000 # Business 62000 $ #@ # Compute the average median salary for each major category, # sorted by increasing salary. # Your result should be a series that begins like this: # Major_category # Psychology & Social Work 30100.000000 # Humanities & Liberal Arts 31913.333333 # Education 32350.000000
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply