Posts

Showing posts with the label NumPy

How to apply Operations on Arrays using NumPy Library

Image
NumPy Library provides lot of useful function that you can apply on n-dimensional arrays(ndarray) for scientific or mathematical computations.  In the subsequent sections we will discuss following functions provided by NumPy Library after importing it in our program. shape( )                        If you have an ndarray and you want to determine its dimensions then you may use  shape( )  for this purpose as shown in example below; From the above output result, i.e.  ‘Out[3]: (3,3)’   after using shape( ) function, you find that you have created an array of dimension   3x3 . Arithmetic Operations  (+,  -, *, /) You can use arithmetic operations i.e. addition, subtraction, multiplication and division to ndarray object. Using arithmetic operations when you use scalar value as second operand with first o...

How to declare an Array Object (ndarray) using NumPy Library

Image
NumPy which stands for “ Num erical  Py thon”  is a fundamental package of python used for data analysis and scientific computing projects.  NumPy  Library provides a feature of n-dimensional array object by which we can contain our large data in flexible way, which is very fast to make scientific or mathematical operations on whole data set that it holds. There are many ways by which you can create or declare n-dimensional arrays.  In this article, we will discuss about some useful functions for this purpose and learn about how to declare an n-dimensional array using following basic functions discussed below:           array( )           reshape( )           zeros( )           ones( )           arange( )           eyes( )           identity( )         ...