subject
Computers and Technology, 19.10.2021 04:00 binu

Creating a Numpy Array The core datatype of NumPy is the NumPy Array. NumPy Arrays build on the basic Python List datatype to add functionality for vector math and common statistical calculations. The easiest way to create a NumPy Array is to first create a List and then passing it as the argument to the np. Array() constructor. In this exercise, you'll create some NumPy arrays, and then perform some simple operations on them.
Resources
Creating a NumPy Array
NumPy Array Shape
Sorting a NumPy Array
Instructions:
Create a 1-dimensional Array, named my_arr containing the elements [9, 8, 7, 6, 5, 4, 3, 2, 1].
Print the shape of my_arr.
Create a 2-dimensional Array, named my_mat containing rows, each containing a copy of my_arr.
Print the shape of my_mat.
Create a new Array named my_prod and use it to store the result of the operation my_arr * my_arr.
Print out my_prod.
Use the np. sort function to sort my_prod and store the result in a new Array named my_prod_sorted.
Print out my_prod_sorted.
Exercise 1 Code Goes Here
(9.)
(3,9)
[81 64 49 36 25 16 94 1]
[14 9 16 25 36 49 64 81)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Which is a possible benefit of having a good credit history? having a checking account low interest rate on a car loan high interest rate on a credit card offer bankruptcy
Answers: 1
question
Computers and Technology, 23.06.2019 22:00
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
You know the right answer?
Creating a Numpy Array The core datatype of NumPy is the NumPy Array. NumPy Arrays build on the ba...
Questions
question
Mathematics, 03.03.2021 07:20
question
Mathematics, 03.03.2021 07:20
question
Mathematics, 03.03.2021 07:20
Questions on the website: 13722367