0% found this document useful (0 votes)
23 views

BioSymphony Exercise Python

The document contains instructions for completing various Python programming tasks including: adding numbers with functions, matrix LU factorization, creating and computing speeds of different array types, finding matrix sparsity, dataframe operations, definite integrals, linear regression, set operations, eigenvalues/eigenvectors, dimensionality reduction, and covariance/correlation matrix calculations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

BioSymphony Exercise Python

The document contains instructions for completing various Python programming tasks including: adding numbers with functions, matrix LU factorization, creating and computing speeds of different array types, finding matrix sparsity, dataframe operations, definite integrals, linear regression, set operations, eigenvalues/eigenvectors, dimensionality reduction, and covariance/correlation matrix calculations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Add 10 numbers using functions in Python Programming.

Func1() will take 10


arguments in the form of 10 numbers and print the summation result. Accordingly,
Func2() will take 10 numbers by using the concept of reference variable or keyword
arguments and simultaneously add those. Compute the time constraints of these two
functions.

2. Create a 3x3 matrix and perform LU factorization.

3. Create one-dimensional, two-dimensional, and three-dimensional arrays using Numpy


module and accordingly compute the speed of different arrays.

4. What is the sparsity of a matrix? Create a sparse matrix and find the sparsity of the
matrix.

5. Create a dataframe like:


Id Age Salary
1 32 10000
2 21 15000
3 54 20000
4 34 24000
5 87 57000
6 43 45000
7 28 87000
8 59 31000
9 45 35000
10 47 65000

Now compute the mean, median, and S.D. of the data. Apply MinMaxScaling
technique to compute each and every rows of Salary column.
MinMaxScaling formula = (data(salary) – minimum of data(salary))/(maximum of
data(salary)-minimum of data (salary))

6. F(x)=x^2 within an interval [0,1]. What would be the value for definite integral?

7. X = [2,4,5,9,14], and y = [3.5,4.1,5.2,9.1,17],,, find the slope and intercept values


after computing linear regression using scipy module.
8. What is the difference between list and arrays?

9. Two sets are present. Set A is consisting = {1,2,3,4,5}, and set B is consisting =
{4,5,6,7,8}. Now figure out the intersection points, and A-B from these two sets.

10. Define a square matrix and find out the eigenvalues and eigenvectors.

11. What do you mean by dimensionality reduction? Create a 10x10 matrix and reduce
the dimensions of the matrix where components would be 5 and print the value.

12. Consider the dataset :


X Y
100 855
150 780
410 444
105 673
450 785
720 109
735 175
801 193
987 1020
441 78

Get the mean covariance from the above dataset without using any inbuilt functions.
Find out the correlation matrix of the dataset.

You might also like