Several routines are available in NumPy package for manipulation of elements in ndarray object. They can be classified into the following types −
Parameter | Description |
---|---|
reshape | Gives a new shape to an array without changing its data |
flat | A 1-D iterator over the array |
flatten | Returns a copy of the array collapsed into one dimension |
ravel | Returns a contiguous flattened array |
Parameter | Description |
---|---|
transpose | Permutes the dimensions of an array |
ndarray.T | Same as self.transpose() |
rollaxis | Rolls the specified axis backwards |
swapaxes | Interchanges the two axes of an array |
Parameter | Description |
---|---|
broadcast | Produces an object that mimics broadcasting |
broadcast_to | Broadcasts an array to a new shape |
expand_dims | Expands the shape of an array |
squeeze | Removes single-dimensional entries from the shape of an array |
Parameter | Description |
---|---|
concatenate | Joins a sequence of arrays along an existing axis |
stack | Joins a sequence of arrays along a new axis |
hstack | Stacks arrays in sequence horizontally (column wise) |
vstack | Stacks arrays in sequence vertically (row wise) |
Parameter | Description |
---|---|
concatenate | Joins a sequence of arrays along an existing axis |
stack | Joins a sequence of arrays along a new axis |
hstack | Stacks arrays in sequence horizontally (column wise) |
vstack | Stacks arrays in sequence vertically (row wise) |
Parameter | Description |
---|---|
resize | Returns a new array with the specified shape |
append | Appends the values to the end of an array |
insert | Inserts the values along the given axis before the given indices |
delete | Returns a new array with sub-arrays along an axis deleted |
unique | Finds the unique elements of an array |
If you are more comfortable learning through video tutorials then we would recommend that you subscribe to our YouTube channel.
When going through coding examples, it's quite common to have doubts and errors.
If you have doubts about some code examples or are stuck somewhere when trying our code, send us an email at coderzcolumn07@gmail.com. We'll help you or point you in the direction where you can find a solution to your problem.
You can even send us a mail if you are trying something new and need guidance regarding coding. We'll try to respond as soon as possible.
If you want to