How to slice an array using python numpy? Is there any numpy tutorial which has covered all its operations?

0 votes
Unable to slice a numpy array.
Apr 24, 2018 in Python by anto.trigg4
• 3,420 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Slicing is basically extracting particular set of elements from an array. It is pretty much similar to the one which is there in the list as well. For example: We have an array and we need a particular element (say 3) out of a given array.

import numpy as np

Output – 3

Here, the array(1,2,3,4) is your index 0 and (3,4,5,6) is index 1 of the python numpy array. Therefore, we have printed the second element from the zeroth index. 
Taking one step forward, let’s say you need the 2nd element from the zeroth and first index of the array.

import numpy as np

Output –[3 5]

answered Apr 24, 2018 by Christine
• 15,790 points

Related Questions In Python

+4 votes
7 answers
0 votes
1 answer
0 votes
1 answer

Is it possible to create an array with all values as zero in python?

You can use  np.zeros(4,3) This will create a 4 ...READ MORE

answered May 24 in Python by Anjali
+1 vote
2 answers

View onto a numpy array?

 just index it as you normally would. ...READ MORE

answered Oct 18, 2018 in Python by roberto
0 votes
1 answer

Printing a large numpy array

numpy.set_printoptions(threshold='nan') READ MORE

answered Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
+1 vote
3 answers

What are the ways of detecting outliners in Python

code from  This uses the L1 distance ...READ MORE

answered Aug 24, 2018 in Python by eatcodesleeprepeat
• 4,670 points

reshown Aug 24, 2018 by Priyaj 46 views
0 votes
1 answer

how to download and install Django rest framework?

To install Django, you can simply open ...READ MORE

answered Apr 24, 2018 in Python by Christine
• 15,790 points

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.