Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The maximum score possible is 15. However, there are 3 extra points given to help in boosting the total in case you have not been
The maximum score possible is 15. However, there are 3 extra points given to help in boosting the total in case you have not been able to answer some of the questions either partiallyffully. 1. Numpy [all sub-questions are 1 point each] a. Write a NumPy program to create a 3x4 matrix A filled with values from 10 to 25. b. Create a 2 x 3 matrix B by slicing the firsttwo rows and the rst three columns of A. c. Create a 3 x 2 matrix C by slicing the last 2 columns ofA. d. Execute matrix multiplication of matrix B by matrix C e. Execute matrix multiplication of matrix C by matrix E f. Transpose matrix A. 2. Pandas fall sub-questions are 1 point each] a. Read data from wwwstatsci.orgfdatafgeneralfuscrime.txt and load it in Pandas dataframe. The descriptions ofthe columns are as below: M percentage of males aged 14-24 in total state population So indicator variable for a southern state Ed mean years of schooling ofthe population aged 25 years or over Pol per capita expenditure on police protection in 1960 Po2 per capita expenditure on police protection in 1959 LF labour force participation rate of civilian urban males in the age-group 14-24 l'v'LF number of males per 100 females Pop state population in 1950 in hundred thousands NW percentage of nonwhites in the population U1 unemployment rate of urban males 1424 U2 unemployment rate of urban males 35-39 Wealth wealth: median value of transferable assets or family income Ineq income inequality: percentage of families earning below half the median income Prob probability of imprisonment: ratio of number of commitments to number of offenses Time average time in months served by offenders in state prisons before their first release Crime crime rate: number of offenses per lUJU population in 1960 Print the number of rows and columns of the dataframe. Print the first 10 rows of the data. Find the rows with crime_rate :> 1900 How many states are indicated as Southern states? Create another column Folnc per capita expenditure increase on police protection from 1959 to 1960. Hint, it is calculated column, calculated as Pol - Pol. 7'5\"??? 3. MatPlotLib [all sub-questions are 2 point each] a. Create a scatterplot, with "Wealth\" in X axis, and "Crime Rate" in Y axis. b. Create a histogram for \"number of males per l females\"; with class intervals of 2. c. Create a pie chart for \"Population"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started