Posts

Previous Year Question Paper Dec 2022 Python For Machine Learning - CST 283 - KTU Minor

 APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY Third Semester B.Tech (Minor) Degree Examination December 2022 (2021 admn.) Course Code: CST283 Course Name: Python for Machine Learning Max. Marks: 100 Duration: 3 Hours PART A Answer all questions. Each question carries 3 marks 1.Write the rules to be followed for naming any variables in python. 2.Illustrate the importance of indentation in python. 3.Illustrate the concept of local and global variables in python with example. 4.Write a program that uses lambda function to multiply two numbers. 5.What is a tuple? Explain the mutability of a tuple with suitable example. 6.Explain List Slicing with suitable examples. 7.Define class, object and methods with an example 8.What is the difference between multiple and multilevel inheritance? Give an example. 9.Write the output of the following code: import numpy as np array1=np.array([10,12,14,16,18,20,22]) print(array1[1:5:2]) print(array1[-4:]) 10.Write a program to plot a range from 1 to 30 with st

63.Programming Assignment 13-using numpy, pandas and matplotlib

1.Do the following matrix operations  addition subtraction multiplication of two matrices 2.Find the Determinant Inverse Trace Transpose Eigen Values and Eigen Vectors of a given matrix 3.Solve the system of linear equations 2x1+3x2 +5x3= 10 3x1-2x2+x3=3 x1+5x2+7x3=8 4.Write Python program to write the data given below to a CSV file.(university question) SN Name                          Country                Contribution                Year 1 Linus Torvalds           Finland Linux       Kernel                          1991 2 Tim Berners-Lee         England                   World Wide Web       1990 3 Guido van Rossum     Netherlands           Python                          1991 5.Given a file “auto.csv” of automobile data with the fields index, company,  body-style, wheel-base, length, engine-type, num-of-cylinders, horsepower,  average-mileage, and price, write Python codes using Pandas

62.Example Programs using numpy and pandas

Add two matrix and find the transpose of the result ( university question) def readmatrix(x,r,c):      for i in range(r):           for j in range(c):                x[i][j]=int(input('enter elements row by row')) import numpy as np r1=int(input('rows of a')) c1=int(input('columns of a')) r2=int(input('rows of b')) c2=int(input('columns of b')) if r1!=r2 or c1!=c2:      print("cant add matrices") else:      A=np.zeros((r1,c1))      print("Enter the elements of A")      readmatrix(A,r1,c1)      B=np.zeros((r2,c2))      print("Enter the elements of B")      readmatrix(B,r2,c2)      print("Matrix A")      print(A)      print("Matrix B")      print(B)      C=A+B      print("sum")      print(C)      print("transpose of sum")      print(C.T) Solving system of linear equations(university questions) let 2x1+3x2 +5x3= 10 3x1-2x2+x3=3 x1+5x2+7x3=8 import numpy as np A=np.array([[ 2 , 3,

61.Pandas-Panal Data and Python Data Analysis

Image
Pandas is a Python library used for working with data sets.It has functions for analyzing, cleaning, exploring, and manipulating data.The name "Pandas" has a reference to both "Panel Data", and "Python Data Analysis" and was created by Wes McKinney in 2008. Pandas is an open-source library that is built on top of NumPy library. It is a Python package that offers various data structures and operations for manipulating numerical data and time series. It is mainly popular for importing and analyzing data much easier. Pandas is fast and it has high-performance and productivity for users. Pandas was initially developed by Wes McKinney in 2008 while he was working at AQR Capital Management. He convinced the AQR to allow him to open source the Pandas. Another AQR employee, Chang She, joined as the second major contributor to the library in 2012. T he source code for Pandas is located at this github repository https://github.com/pandas-dev/pandas Installation and