Q. A company randomly generates a weekly winning number (between 0..100) for 10 weeks. An employee of the company wants to plot the sine values of winning numbers (nump.sin() function) on a line chart. Write a program to help him accomplish this.
Answer :-
import matplotlib.pyplot as plt
import numpy as np
ar1 = np.random.randint (100, size = (10,))
sinar = np.sin(ar1)
plt.plot(ar1, sinar)
plt.xlabel('Weekly Numbers')
plt.ylabel('Sine Values')
plt.show()
Output :-
ty /:
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )