1) Answer the following about NumPy arrays: a) (5 pts) Given a Python list named Ist I, containing the first 5 odd integ

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

1) Answer the following about NumPy arrays: a) (5 pts) Given a Python list named Ist I, containing the first 5 odd integ

Post by answerhappygod »

1 Answer The Following About Numpy Arrays A 5 Pts Given A Python List Named Ist I Containing The First 5 Odd Integ 1
1 Answer The Following About Numpy Arrays A 5 Pts Given A Python List Named Ist I Containing The First 5 Odd Integ 1 (48.43 KiB) Viewed 60 times
1) Answer the following about NumPy arrays: a) (5 pts) Given a Python list named Ist I, containing the first 5 odd integers, give a simple code to create a NumPy array, named arrl, of single-precision (4 byte) floats, containing the first 20 odd integers using Ist1 converted to floats, as: 1.0, 3.0 etc. b) (5 pts) Give code to create a 4x5 2-dimensinal NumPy array, named arr2, of integers randomly drawn from the interval [0, 20). c) (6 pts) Assume arr is created as: arr = arrl + arr2 What would be the value of each of the following attributes of the array arr? i) ndim ii) shape iii) size d) (4 pts) Give code to get the last row of array arr2. 2) Give code to: a) (5 pts) create a Pandas Series, sl, of 26 elements containing all the characters a', 'b', .... z'. b) (5 pts) create a Pandas dataFrame, dfl, with two rows, the first one containing the first 26 positive integers, and the second row containing their opposite (negative) counterparts. c) (5 pts) vertically stack sl and dfl. d) (10 pts) horizontally stack sl and dfl. e) (10 pts) Using a universal function (ufunc), give code to return at once the average of each of the two rows of afl.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply