Learn Python
Learn Data Structure & Algorithm
Numpy Introduction
Numpy Array
Numpy Attributes
Numpy generate random numbers
Numpy Slicing
Numpy Concatenate & split
Numpy Insert & delete
Numpy Math
Numpy Condition
Numpy Reshaping
Learn Pandas
Matplotlib
Learn Seaborn
Learn Statistics
Learn Math
Learn MATLAB
Learn Machine learning
Learn Github
Learn OpenCV
Learn Deep Learning
Learn MySQL
Learn MongoDB
Learn Web scraping
Learn Excel
Learn Power BI
Learn Tableau
Learn Docker
Learn Hadoop
Here D means dimension. One dimensional array contains elements only in one dimension. It looks like a simple python list but it is not a list. We use python list to create a numpy array. If you convert a simple list into an array(1-dimensional matrix ) then it will be a 1D or 1 dimensional array. To convert a list into an array or matrix array() function is used. In the function bracket, write the variable name where the list is stored.
In the example we have a python list. Now we want to convert it into a numpy array. To do this we just passed the list in the array() function. Now the list become a one dimensional array.
Here D means dimension. Two dimensional array contains elements in two dimension. It looks like some python lists are stored in an python list but those are not lists. We use python list to create a numpy array. Suppose you have a list and inside that list you have some other list. Now if you convert this outer list into an array then it will called 2D array. To convert python list into an array or matrix array() function is used. In the function bracket, write the variable name where the list is stored.
In the example we have two python list inside list. Now we want to convert this list into a two dimensional array. To do this we will pass this list in the array() function. After passing the list become a two dimensional array.
Suppose you have a python list that contains data like 2D array means(a list contains some other list in it) then it is called a 3D array. It is a multi-dimensional array, so it has length, width, and depth. To convert a python list into an array use the array() function. In function, bracket write the variable name where the list is stored.
We have a python list. Inside that list another list and inside this list we have two lists. Now we want to convert it into an array. To do this we will use numpy array function and after this we will get a three dimensional array.
All values of the zeros matrix are zero. To create zeros matrix use zeros() function. In the function bracket, pass the row and column number. Row and column number means how many columns and rows you want in the matrix. In the bracket first value is for the row and the second value is for the column.
All values of ones matrix are one. To create ones matrix use ones() function. In the function bracket, pass the row and column number. It mean how many columns and rows you want in the matrix. In the bracket first value is for the row and the second value is for the column.
In eye matrix all the diagonal values are 1 and remaining all the values will be 0. To create an eye matrix eye() function is used. In the function bracket, pass the row and column number. It means how many columns and rows we want in the matrix. In the bracket first value is for the row and the second value is for the column.
To create diagonal matrix diag() function is used. In the function bracket, pass a list that will contain the diag values of the matrix. Diagonal value means, all the values will be zero except diagonal values and the diagonal values will be those values that you passed in the array. In the array, if you have 5 values then 5 rows and 5 columns will be created and if you have 2 values then 2 rows and 2 columns will be created.
To find the diag value of a diag matrix write the diag function and in the bracket pass diag matrix variable name.
The matrix function is used to create a matrix. In the bracket, pass the values row wise. For separate row semi-color is used. It takes tree parameter, 1.data or value, 2.data type 3.copy(value True or False). The mathematical operation can be also performed which can be performed with the array.
1.You can create a matrix with string notation but can't create an array.
2.Matrix is always 2D but the array can be 3D,4D, and more.
3.Array and matrix multiplication are different.