Question

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(())

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Points to consider:

1. First, we need to find the standard deviation of the numbers in the array.
2. Then we need to find the contour plot.

Code

import numpy as np
import matplotlib.pyplot as plt

# given X and Y arrays
X, Y = np.meshgrid(np.arange(0,10),np.arange(0,10))
A_99 = np.array((X, Y))
print(A_99)
print("The Standard Deviation: " + str(np.std(A_99)))

Z = np.sqrt(X**2 + Y**2)
cp = plt.contourf(X, Y, Z)
plt.colorbar(cp)
plt.show()

Code Snippet

Output

Friend, That was a nice question to answer
If you have any doubts in understanding do let me know in the comment section. I will be happy to help you further.
Please like it if you think the effort deserves.
Thanks

Add a comment
Know the answer?
Add Answer to:
In Python use the two arrays, X and Y, given below to create A_99 using numpy...
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
  • 3 Compute Euclidean distance using Numpy Arrays • The Euclidean distance d is given by the...

    3 Compute Euclidean distance using Numpy Arrays • The Euclidean distance d is given by the following equation: N d(a,b) = (a - b)2 Complete the following Euclidean distance function with two parameters of Numpy arrays • Hint: you may use np.sqrt and np.sum to compute the two Numpy arrays [73]: def euclidean_distance(a,b): return 0 Test your Euclidean distance function using two Numpy arrays [74]: A = np.array(range(100)) B - np array(range(1, 101)) print (euclidean_distance (A,B)) 0 [ ]:

  • 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...

  • 7. i) Let n and k be some given positive integers, and x a 1-dimensional NumPy...

    7. i) Let n and k be some given positive integers, and x a 1-dimensional NumPy array of length n. Write a Python code that creates the 2-dimensional NumPy array which has k columns all identical to x. You may import numpy as np Perform the test case: ne5 k-3 x = np.arange(0,1,0.2) # the output should be [[. 0. 0.] [0.2 0.2 0.2] [0.4 0.4 0.4) (0.6 0.6 0.6) [0.8 0.8 0.8]] 7. ii) Let a, b, c be...

  • Using Python please create a code that #Use NumPy and MatPlotLib to create a plot of...

    Using Python please create a code that #Use NumPy and MatPlotLib to create a plot of f(x) = x**4 + 10 # in the range x=(-10, 10) (inclusive), with a point on the plot every 0.5 change in x. # Include the correct import statements

  • Using Python - Pandas and Numpy Data Structures: *use np.randint create 2 columns of 10 random...

    Using Python - Pandas and Numpy Data Structures: *use np.randint create 2 columns of 10 random numbers from dataframe *Code for creating and printing a 2 by 3 numpy array of random numbers

  • 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...

  • plz dont use numpy, just python with loop: Create a vector of size 50 with values...

    plz dont use numpy, just python with loop: Create a vector of size 50 with values ranging from 50 to 99 and store in variable x

  • 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...

  • code that I started: # THIS IS NEEDED TO USE ARRAYS IN PYTHON: from array import * # THIS IS NEEDED TO MAKE PLOTS IN PY...

    code that I started: # THIS IS NEEDED TO USE ARRAYS IN PYTHON: from array import * # THIS IS NEEDED TO MAKE PLOTS IN PYTHON: import matplotlib.pyplot as plt # IMPORT A ROUTINE FROM NUMPY USEFUL FOR CREATING AN # ARRAY FILLED WITH ZEROS from numpy import zeros # THIS COMMAND CREATES AN ARRAY OF ZEROS WITH DESIRED SHAPE: V=zeros([31,21]) newV=zeros([31,21]) # SET UP THE BOUNDARY VALUES: V=8 ON TOP OF BOX iy=20 for ix in range(0,31): V[ix,iy]=8.0 #...

  • please use python thanks will rate!! x + Run C Code Validate Implement the function step_random_walk_20(x_coords,...

    please use python thanks will rate!! x + Run C Code Validate Implement the function step_random_walk_20(x_coords, Y_coords) below, which should take two arrays of equal length containing the x-andy- coordinates for some number of particles. We'll use a very simple random walk algorithm • For each particle, choose a random angle between 0 and 2 • The particle moves by 1 unit of distance in the direction given by d.o. It is displaced by (Ax, Ay) (cos, sino). We'll do...

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