Hello Friends!!! Welcome again,
Today we are going to discuss more methods of NumPy module. I hope you all do well with NumPy. So, let's start with NumPy and learn some more methods.
These are methods of NumPy for this article that's it, in next article we will learn more methods.
Happy Learning & Coding...☺😊
Today we are going to discuss more methods of NumPy module. I hope you all do well with NumPy. So, let's start with NumPy and learn some more methods.
- numpy.delete - this method is used to remove elements from an array. it returns a new array with sub-array along with axis that is deleted.
- Syntax: numpy.delete(array,index,axis=None)
- Here, array - represents an array from which you want to remove elements.
- index - represents indexes of sub-arrays to remove along the specified axis. it may be any object.
- axis - is an optional parameter. represents an axis along which to delete the sub-array defined in an index argument.
- It returns a ndarray. A copy of an array with the elements specified by the index removed.
- Example,
- numpy.concatenate - this method is used to join different arrays along with an existing axis.
- Syntax: numpy.concatenate((ar1, ar2, ...),axis=0,out=None)
- Here, ar1, ar2 - represents a sequence of arrays, all the array must have the same shape.
- axis - is an optional argument, represents axis along which arrays will be joined. here default value of this parameter is 0.
- out - is an optional parameter, it is ndarray object. represents the destination to place the result.
- It returns ndarray object after concatenation of arrays.
- Example,
These are methods of NumPy for this article that's it, in next article we will learn more methods.
Happy Learning & Coding...☺😊
No comments:
Post a Comment