You are on page 1of 2

NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA

SURATHKAL, MANGALORE-575025

THE INSTITUTION OF ENGINEERS, NITK CHAPTER


Institutional Member ID: IM0001491
https://ie.nitk.ac.in

Summer Mentorship Programs 2023


Surface crack on concrete image detection
Assignment -1

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] ]

- 1 using (adj A)/|A| (verify using inv() in linear algebra of numpy)


a) A
b) The Normal Equation form for Linear Regression i.e ( X T . X ) -1 .X T . Y
Note : “ . ” refers to the dot product
3. Use the vehicles.csv ile attached to answer the following questions :
a) Display all the automatic transmission type vehicles
b) Sort the vehicles according to the prices followed by km driven and display the
top 10 vehicles
c) Display all the petrol type vehicles of selling price below 10 lakhs and model
year of 2015
d) Group the vehicles according to their name display the average present price
in descending order
NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA
SURATHKAL, MANGALORE-575025

THE INSTITUTION OF ENGINEERS, NITK CHAPTER


Institutional Member ID: IM0001491
https://ie.nitk.ac.in

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.

You might also like