0% found this document useful (0 votes)
12 views2 pages

Data Communication Notes

The document contains Python code for performing operations on a 2D matrix using NumPy, including addition, subtraction, multiplication, transposition, and determinant calculation. It also includes a program to represent data using Matplotlib to create a simple line graph. The output of these programs is not provided in the document.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Data Communication Notes

The document contains Python code for performing operations on a 2D matrix using NumPy, including addition, subtraction, multiplication, transposition, and determinant calculation. It also includes a program to represent data using Matplotlib to create a simple line graph. The output of these programs is not provided in the document.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

GRAMIN TECHNICAL AND MANAGEMENT CAMPUS VISHNUPURI NANDED

NAME :- PRASHIK BHUSAWALE ROLL NO:- 51


PRACTICAL NO:- 19 (PYTHON)
✓ Program to Perform Operations on a 2D Matrix using
NumPy
import numpy as np

A = np.array([[1, 2], [3, 4]])


B = np.array([[5, 6], [7, 8]])

print("Matrix A:\n", A)

print("Matrix B:\n", B)

print("Addition of A and B:\n", np.add(A, B))

print("Subtraction of A and B:\n", np.subtract(A, B))


print("Multiplication of A and B:\n", np.dot(A, B))

print("Transpose of A:\n", np.transpose(A))

print("Determinant of A:", np.linalg.det(A))

✓ Program to Represent Data Using Matplotlib


import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]

y = [10, 20, 25, 30, 40]

plt.plot(x, y, marker='o', linestyle='-', color='b', label="Data Line")

plt.xlabel("X-axis")
plt.ylabel("Y-axis")

plt.title("Simple Line Graph")

plt.legend()

plt.grid()

➢ plt.show()
GRAMIN TECHNICAL AND MANAGEMENT CAMPUS VISHNUPURI NANDED
NAME :- PRASHIK BHUSAWALE ROLL NO:- 51
PRACTICAL NO:- 19 (PYTHON)
➢ output :-

You might also like