Assignment-8



Learn to handle files ,numpy and scipy  package :All university questions

submit before 18th sep 10pm



1.Describe random number generation using Python

2.How can a generalized eigen value problem can be solved using Python?

3. Write python program to solve the following system of equations (4)x1 − 2x2 + 9x3 + 13x 4 = 1
−5x1 + x2 + 6x3 − 7x4 = −3
4x1 + 8x2 − 4x3 − 2x4 = −2
8x1 + 5x2 − 7x3 + x 4 = 5

4.Explain how integration is performed with SciPy. Illustrate the same with the two sample integrals using SciPy function

5.Describe various modes of opening a file ? Explain any two in detail 

6.Generate a 1-D array of 10 random integers. Each integer should be a number
between 30 and 40 (inclusive)


7. Write a python program to convert a list of numeric values into a one-dimensional
NumPy array.

8.Illustrate how numpy arrays are created with examples. How indexing,
arithmetic operations and slicing is done with examples.

9.What are the two types of files? Explain different file operations 

10. Write a python program to count the number of words in a text file

11.Explain with example the difference between read(), readline() and readlines()
functions associated with files in python.

12.Illustrate the following methods to generate random numbers
(i) rand() (ii) randn() (iii) randint()


13. With example explain eye() and reshape() in matrix operations.

14.Create a file “num.txt” with 10 integer numbers, write the odd numbers to
another file named “odd.txt” and find the sum and average of odd numbers

15.Write a python program to calculate the eigen values and eigen vectors of a
matrix, A= [
0 2
2 3
]

16.With example explain the different methods of creating a one-dimensional array
using NumPy.

17.Compare ode and odeint with an example.

18. List the functions of SciPy.

19.Explain how integration is performed with SciPy with an example.

20.Explain the following built-in methods in NumPy with suitable example.
(i) logspace() (ii) linspace() (iii) arange()


21. Write a python code to read any two 3x3 matrix and perform matrix
multiplication.

22Write a python code to perform the following double integral.

23.Differentiate the functions write() and writelines() in Python with examples.

24.Discuss on any 3 functions in Python to generate random numbers.

25.Create a matrix using numpy and find its transpose, inverse, determinant, and
rank. Also compute the eigenvalues and eigenvectors of the matrix.

26.Write a program to read the contents of a text file and write them in uppercase to
another file.

27.Explain the creation, indexing, slicing and arithmetic operations of a one-
dimensional numpy array with examples.

Comments

Popular posts from this blog

Python For Engineers CST 445 KTU Open Elective Notes S7 - Dr Binu V P

Model Question Paper CST 445 KTU Python For Engineers

Plotting- Simple plots,setting limits,subplot, semilog, loglog plots