Professional Documents
Culture Documents
Assignment 1
Assignment 1
SURATHKAL, MANGALORE-575025
1. Create a new NumPy array from the given NumPy array as per the following
conditions:
[1,-1,6,8,9,6,14,-5,-3,6,4,17,-5,3,9,6,7,-2,10,6,12,6,19,25,7,-5,4,16,7,9,15,-9,5,7,9,-5,6]
a) True if positive integer False if negative integer
Ex: [2,-3,4,5] to [True,False,True,True]
b) Set all negative integers to 0
Ex: [0,-1,6,-5] to [0,0,6,0]
c) Square of the elements
Ex: [2,-3,4,-5] to [4,9,16,25]
2. Evaluate the following expressions for the given matrices
A=[
[2,8,9] X =[ [4] Y=[ [12]
[5,7,4] [5] [15]
[9,6,3] ] [1] ] [3] ]
4. Plot the following graphs in a single plot using the domain as NumPy array ranging
from 0 to 5 at a step of 0.1 and add the graph features like X-axis, Y-axis, Title of the
graph, Legends (Markers are not necessary). Find the values of each function value
at x=3 using annotate() of matplotlib.pyplot
a) y=ex
b) y=x3
5. Plot the Load vs Ivory scale reading for the attached dataset TensileTest.csv for the
tensile test of mild steel. Add the graph features like corresponding x-axis, y-axis,
title, legend.