0% found this document useful (0 votes)
8 views11 pages

Software Experimentation Project-1

The document outlines a software experimentation project focused on displaying two matrices using NumPy in Python. It provides an introduction to Python and NumPy, detailing their features, uses, and installation procedures. Additionally, it includes sample code for creating and displaying two matrices based on user input.
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)
8 views11 pages

Software Experimentation Project-1

The document outlines a software experimentation project focused on displaying two matrices using NumPy in Python. It provides an introduction to Python and NumPy, detailing their features, uses, and installation procedures. Additionally, it includes sample code for creating and displaying two matrices based on user input.
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/ 11

SOFTWARE EXPERIMENTATION PROJECT

Topic:- Display Two Matrices in NumPy.

Course: - SY iMCA

Div :- A

Mentored By: - Presented By:-


Prof.Ruchika Rami 202202519010037 :- Palasara Salman.
202202519010058 :- Raulji Jaydeep Singh.
202202519010056 :- Rana Amaan.
What is Python?

➢ Python is a general-purpose, dynamic, high-level, and interpreted


programming language. It supports Object Oriented programming
approach to develop applications. It is simple and easy to learn and
provides lots of high-level data structures.
➢ Python is an easy-to-learn yet powerful and versatile scripting language,
which makes it attractive for Application Development.
➢ With its interpreted nature, Python's syntax and dynamic typing make it
an ideal language for scripting and rapid application development.
➢ Python supports multiple programming patterns, including object-
oriented, imperative, and functional or procedural programming styles.
➢ Python is not intended to work in a particular area, such as web
programming. It is a multipurpose programming language because it can
be used with web, enterprise, 3D CAD, etc.
➢ We don't need to use data types to declare variable because it is
dynamically typed, so we can write a=10 to assign an integer value
in an integer variable.
➢ Python is an open-source, cost-free programming language. It is
utilized in several sectors and disciplines as a result.
➢ Python has many third-party libraries that can be used to make its
functionality easier. These libraries cover many domains, for
example, web development, scientific computing, data analysis,
and more.

What is NumPy?

➢ NumPy stands for numeric python which is a python package for the
computation and processing of the multidimensional and single
dimensional array elements.
➢ NumPy is a Python library used for working with arrays.
➢ It also has functions for working in domain of linear algebra, fourier
transform and matrices.
➢ NumPy was created in 2005 by Travis Oliphant. It is an open source
project and you can use it freely.
➢ NumPy is the fundamental package for scientific computing in
Python. It is a Python library that provides a multidimensional
array object, various derived objects (such as masked arrays
and matrices), and an assortment of routines for fast
operations on arrays, including mathematical, logical, shape
manipulation, sorting, selecting, I/O, discrete Fourier
transforms, basic linear algebra, basic statistical operations,
random simulation and much more.

The Need of NumPy.

➢ NumPy performs array-oriented computing.


➢ It efficiently implements the multidimensional arrays.
➢ It performs scientific computations.
➢ It is capable of performing Fourier Transform and reshaping the data
stored in multidimensional arrays.
➢ NumPy provides the in-built functions for linear algebra and random
number generation.

Uses of NumPy.
➢ Arithmetic Operation.
➢ Statistical Operation.
➢ Bitwise Operations.
➢ Copying and Viewing arrays.
➢ Stacking.
➢ Linear Algebra.
➢ Broadcasting.
➢ Mathematical Operations.
➢ Searching, sorting and counting.

Features of NumPy.
➢ Efficient Array Operation.
➢ Slicing Array.
➢ Random Number Generation.
➢ Numerical Computing Tools.
➢ Universal function.

Download Procedural.

➢ Open a web browser and navigate to the Downloads for Windows


section of the official Python website.
➢ Click the link to download the file. Choose either the Windows 32-bit or
64-bit installer.
➢ The download is approximately 25MB.

➢ Run the downloaded Python Installer.


➢ The installation window shows two checkboxes:
➢ Admin privileges. The parameter controls whether to install Python for
the current or all system users. This option allows you to change the
installation folder for Python.
➢ Add Python to PATH. The second option places the executable in the
PATH variable after installation. You can also add Python to the PATH
environment variable manually later.
➢ For the most straightforward installation, we recommend ticking both
checkboxes.
➢ Choose the optional installation features. Python works without these
features, but adding them improves the program's usability.
➢ Click Next to proceed to the Advanced Options screen.

➢ he second part of customizing the installation includes advanced options.


➢ Choose whether to install Python for all users. The option changes the
install location to C:\Program Files\Python[version]. If selecting the
location manually, a common choice is C:\Python[version] because it
avoids spaces in the path, and all users can access it. Due to
administrative rights, both paths may cause issues during package
installation.
➢ Other advanced options include creating shortcuts, file associations, and
adding Python to PATH.
➢ After picking the appropriate options, click Install to start the
installation.

➢ Select whether to disable the path length limit. Choosing this


option will allow Python to bypass the 260-
character MAX_PATH limit
➢ The option will not affect any other system settings, and disabling
it resolves potential name-length issues. We recommend selecting
the option and closing the setup.
➢ Check the version because download is completed or not properly
without an error.
➢ The output shows the installed Python version.

➢ Download the NumPy library in cmd prompt.


➢ Successfully Download the NumPy library.

Display two matrices in NumPy.

First Matrices program.

row=int(input("Enter a number of rows"))


column=int(input("Enter a number of column"))

matrix = []

for i in range(row):
c=[]
for j in range(column):
j = int(input("enter a number in Array Element "+str(i)+" "+str(j)+"
"))
c.append(j)
print()
matrix.append(c)

for i in range(row):
for j in range(column):
print(matrix[i][j],end=" ")
print()
Second Matrices Program.

row=int(input("Enter a number of rows"))


column=int(input("Enter a number of columns"))

matrix = []

for i in range(row):
c=[]
for j in range(column):
j = int(input("enter a number in second array element"+str(i)+"
"+str(j)+" "))
c.append(j)
print()
matrix.append(c)

for i in range(row):
for j in range(column):
print(matrix[i][j],end=" ")
print()

Program Explanation.

➢ The User Enter the Number of Rows for the Matrix and assign the
entered value to the row variable after converting it to an integer.
➢ The User Enter the Number of Columns for the Matrix and assign the
entered value to the column variable after converting it to an integer.
➢ Matrix[] – initialize an Empty array.
➢ for i in range(row): Start a loop that iterates over the range of values
from 0 to row-1.it is used for iterating through each row of the matrix.
➢ c=[] :-initialize an empty array.
➢ for j in range(column): Start a nested loop that iterates over the range of
values from 0 to column-1.it is used for iterating through each column of
the current row.
➢ j = int(input("enter a number in second array element"+str(i)+" "+str(j)+"
")) :- The user to Enter a Number for the current matrix element and
assign the entered value to the variable ‘j’. After converting it an integer.
The use of str(i) and str(j) is for displaying the current position in the
matrix while taking input.
➢ c.append(j):- Adds the entered value(‘j’) to the array ‘c’, representing the
current row.
➢ Print() :- Prints a newline to separate rows in the output.
➢ matrix.append(c) :- Appends the array of ‘c’ to the main matrix array.
➢ for i in range(row): - Initiates another loop to iterate over the rows of the
matrix for printing.
➢ for j in range(column): - Initiates a nested loop to iterate over the
columns of the matrix for printing.
➢ print(matrix[i][j],end=" ") :- Prints each element of the matrix at position
‘[i][j]’ followed by a space.
➢ Print() :- Prints a newline after each row to format the matrix in a
readable way.
➢ This code takes a user input to create a matrix, stores it in a array, and
then prints the matrix.

You might also like