Question

This is a Python question. This is a Python question. This is a Python question. Create...

This is a Python question.

This is a Python question.

This is a Python question.

Create two Numpy arrays. First, array X of shape 3x4 filled with random normal numbers (see np.randn). Second, array Y of 5x4 filled with consecutive integers starting at zero. Add the two arrays using broadcasting to create an array of shape 3x5x4. You will need to insert an axis of length 1 in the right place to do that. See np.newaxis. Store the result in array Z. Print out the subarray produced when slicing the array along axis 1 with location 4. (See lecture on indexing multidimensional arrays.) The result should be shape 3x4, since axis 1 (of length 5) was indexed with a scalar. (Remember, axis 1 is the second axis.)

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
This is a Python question. This is a Python question. This is a Python question. Create...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In Python use the two arrays, X and Y, given below to create A_99 using numpy...

    In Python use the two arrays, X and Y, given below to create A_99 using numpy array math rather than a for-loop. Then calculate the standard deviation of A_99 and create a filled contour plot of X, Y, A_99. # given X and Y arrays X,Y = np.meshgrid(np.arange(0,10),np.arange(0,10)) A_99 = np.array(())

  • Select the description(s) that result in a ragged 2-D (matrix) array instantiation. (This means that directly after the...

    Select the description(s) that result in a ragged 2-D (matrix) array instantiation. (This means that directly after the described instantiation, the matrix will be a ragged array with some row lengths being different from other row lengths in the matrix, not a matrix in which all the row lengths in are the same.) A. A NumPy 2-D array whose shape is described by a tuple, like (4, 8) or (3, 4), passed to the constructor. B. A Python list-of-lists in...

  • The following are short Python calculations. Give the answer and the Python code for each. 1....

    The following are short Python calculations. Give the answer and the Python code for each. 1. What is the sum of the numbers from 22:100 incrementing by 2? Do this in two ways: Use a while statement and a for loop to do the calculation. (Hint: make sure the numbers include 100) 2. What is the mean, standard deviation of the square root of the numbers from 3 to 5 incrementing by 0.1? Use the linspace function from the numpy...

  • need help with this python progam using numpy Create a 4x4 two dimensional array with numbers...

    need help with this python progam using numpy Create a 4x4 two dimensional array with numbers from 1 thru 16. show this then: Change the last element by dividing it in half. Show that the original array has changed. show this then: Set all values in row 2 to zero. Show the original array contains this change show this then: Set all values in column 1 to one. Shoe the original array contains this change. show this then: Display the...

  • In python, how do you create an array of unknown dimensional size? I want to create...

    In python, how do you create an array of unknown dimensional size? I want to create an array of unknown dimensional size based on a number I recieve. To elaborate, let's say n = 2, it will output a 3D array {true, true, true}. If n = 3, then its output will be a 4D array {true, true, true, true}. Whatever the n value is, the return value will be an array of n + 1 dimensional size. How would...

  • Assignment is designed to develop your ability to create static methods and manipulate 1D and 2D...

    Assignment is designed to develop your ability to create static methods and manipulate 1D and 2D arrays in Java. Create a single Java class Matrix and inside the class create the specified static methods as described Task # Description 1 Create a matrix (known components) 2 Create a matrix (random components) 3 Create a matrix from vectors 4 Compare two matrices 5 Add two matrices 6 Subtract two matrices 7 Multiply a matrix by a scalar 8 Multiply two matrices...

  • Python code: 1. This question practices the use of a list method. Assign to the variable...

    Python code: 1. This question practices the use of a list method. Assign to the variable grades a list of 10 letter grades from among ‘A’, ‘B’, ‘C’, ‘D’, and ‘F’. For example: grades = [‘A’, ‘F’, ‘C’, ‘F’, ‘A’, ‘B’, ‘A’, ‘C’, ‘A’, ‘B’] Write a Python expression that creates a list named frequency, in which the elements are the number of times each of the letters A, B, C, D and F appear in grades. For example, for...

  • D Question 12 1.5 pts Check the true statements about NumPy arrays: O A single instantiated NumPy array can store multi...

    D Question 12 1.5 pts Check the true statements about NumPy arrays: O A single instantiated NumPy array can store multiple types (e.g., ints and strings) in its individual element positions. A NumPy array object can be instantiated using multiple types (e.g., ints and strings) in the list passed to its constructor O Memory freeing will require a double-nested loop. The number of bits used to store a particular NumPy array object is fixed. O The numpy.append(my.array, new_list) operation mutates...

  • do it in python 1. Import the proper libraries: Pandas and NumPy and create aliases pd,...

    do it in python 1. Import the proper libraries: Pandas and NumPy and create aliases pd, np respectively. 2. Load sample data (car_loan.csv) into data frame: df 3. Export Pandas DataFrames to csv. Save file name as out.csv. hint: help(df.to_csv) 4. Run the command: df.info (). What do you see, how many columns? also what about number of entries for each column 5. It is often the case where you change your column names or remove unnecessary columns. a. Change...

  • Hi there, I'm bit frustrated to see that your website has a same question posted many...

    Hi there, I'm bit frustrated to see that your website has a same question posted many times but no solution. Why? I have purchased subscription to get solution that claimed on your page. Why I can\t see the solution? For example, the following Question doesn't have a solution: Write a function, equalsArray that when passed two int arrays of the same length that is greater than 0 will return true if every number in the first array is equal to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT