Question: OL - CSCl 3 6 1 Data Structures and Algorithms Weekly Assignment 1 God is our refuge and strength, a very present help in trouble.

OL-CSCl361 Data Structures and Algorithms
Weekly Assignment 1
"God is our refuge and strength, a very present help in trouble. Therefore we will not fear though the earth should change, though the mountains shake in the heart of the sea; though its waters roar and foam, though the mountains tremble with its tumult." - Psalm 46:1-3(RSV)
You may do your work in Jupyter Notebook, VS Code, or Visual Studio. However, you must submit only one .py file to Moodle. This means that if you do your work in Jupyter Notebook, you must copy the code to a .py file before submitting.
Simple Challenges
Show that you understand the basics -30%[2.4 hour]
Create a NumPy array with the following values in this order and print it out. 921638[10 min challenge]
Create a 2D NumPy array with 82157 in the top row and 01635 in the bottom row and print it out. [10 min challenge]
Create a NumPy array of the numbers from 1-12 in sequence. You must use the special method provided by NumPy that makes this particular task easier than what you are asked to do in question 1. Print the array. [20 min challenge]
Change the array that you created in question 3 to be 2D with a width of 4. Do this to the existing array from question 3. Do not create a new one. Print it out again. [20 min challenge]
Print out only the second row of the array from question 4. Do this on only one line of code. (Do not use a "list comprehension")[25 min challenge]
Use broadcasting to multiply all the values in the array from question 4 by the value of 50. Print the result. [10 min challenge]
Create a view of the middle 2 columns of the array from question 6. Print the result. [20 min challenge]
Use NumPy questions to print an array of the same dimensions as the array from question 4 however it shows only True where the number was less than the number 5, otherwise False. [30 min challenge]
Research Challenges
Often programmers must look up how to do things because no one can know all there is to know in coding. These challenges test in part your ability to research how to do particular things. For all these questions provide references for where you learned what you needed to know to solve the problem. -30%[2.4 hour]
9. Create a 2D NumPy array that is 5 wide and 3 tall with all 1s and print it out. However, to do this, you must use the special method provided by NumPy that makes this particular task easier. It is a method that was not discussed in the video lectures. So, look it up.[25 min challenge]
10. Create a NumPy array with 9 numbers that are evenly spaced going from 0 to 2. There is a NumPy method specifically designed for creating this. Look it up. Print out the result. [30 min challenge]
11. Create a 2D NumPy array that is 2 wide and 2 tall with numbers going from 1 to 4. Create a second 2D NumPy array that is 2 wide and 2 tall with numbers going from 5 to 8. Find the NumPy method that you need to stack them producing a combined array that is 2 wide and 4 tall. Print the result. [30 min challenge]
12. Find the NumPy method that you need to split the 24 array from question 11. Split it vertically producing two arrays that are 1 wide and 4 tall. Print both of them. [30 min challenge]
13. Create a 3D NumPy array that is 3 wide, 3 tall and 3 deep. Create it with random numbers. There is a NumPy method just for creating an array with random numbers that you must use. (Actually there is more than one. Feel free to choose which one to use.) Print the array. [30 min challenge]
 OL-CSCl361 Data Structures and Algorithms Weekly Assignment 1 "God is our

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!