Sale!

CS 5600/6600 Assignment 0 Python Fundamentals Solved

Original price was: $35.00.Current price is: $30.00.

Download Details:

  • Name: A-00_-Python-Refresher-5t4rhq.zip
  • Type: zip
  • Size: 156.77 KB

Category:

Description

5/5 - (1 vote)

Problem 1
In this part of the assignment, Numpy arrays. Create a 1D NumPy array of
shape [1×5] with random values drawn from a uniform distribution. Perform
the following operations:
• Compute the mean and standard deviation of the array.
• Reshape the array into a 2D array with 5 rows and 1 column.
• Add 5 to each element in the array and print the result.
• Compute the dot product of this reshaped array with itself.
After each step, print the resulting value.
Problem 2
In this part of the assignment, you will be working with visualizing plots with
Matplotlib. Generate a set of x values ranging from 0 to 100 with an
increment of 0.1 using NumPy. Compute the corresponding y values using
the function y=sin(x). Plot the sine wave using Matplotlib, and add
appropriate labels for the x-axis, y-axis, and a title for the plot. Save the plot
as a PNG file named “sine_wave.png”.
Problem 3
In this part of the assignment, you will be integrating NumPy and Matplotlib
to analyze and visualize data. Perform the following steps:
• Create two NumPy arrays: one for x values ranging from 0 to 100 with
an increment of 1, and another for y values that represent a quadratic
function y=0.5×2 +2x+1.
• Plot the quadratic function using Matplotlib with appropriate labels and
a legend.
• Add gridlines to the plot and display it with a line style of your choice.
• Save the plot as a PDF file named quadratic_function.pdf.