Top "Indices" questions

Use this tag for questions about specifying or selecting the correct information from a structure using indices.

In TensorFlow, how can I get nonzero values and their indices from a tensor with python?

I want to do something like this. Let's say we have a tensor A. A = [[1,0],[0,4]] And I want to get …

python tensorflow indices
compare two lists in python and return indices of matched values

For two lists a and b, how can I get the indices of values that appear in both? For example, …

python list match indices
Splitting a string by list of indices

I want to split a string by a list of indices, where the split segments begin with one index and …

python string split indices
Python: TypeError: list indices must be integers, not list

I've got two lists of coordinates, they look like this: list_kp2_ok: [[1185.60009765625, 933.6000366210938], [1310.4000244140625, 828.0000610351562], [1067.0, 979.0], [1310.0, 828.0], [1423.2000732421875, 814.800048828125], [1306.0, 828.0], [3634.0, 605.0], [1308.0960693359375, 827.7120971679688], [1422.7200927734375, 815.0400390625], [1185.1199951171875, 933.1200561523438], [1186.56005859375, 923.0400390625], [1306.3681640625, 829.4401245117188], [1194.393798828125, 839.80810546875], [1187.1361083984375, 922.7520751953125], [1082.8800048828125, 849.6000366210938]] list_kp2_2_ok: [[835.0, 1201.0], [1086.0, 850.0], [1187.0, 924.0], [1197.0, 839.0], [1310.0, 828.0], [3634.0, 605.0], [1195.2000732421875, 838.800048828125], [1308.0, 828.0000610351562], [1084.800048828125, 849.6000366210938], [1310.4000244140625, 828.0000610351562], [1186.800048828125, 924.0000610351562], [1296.0, 956.4000244140625], [1082.8800048828125, 849.6000366210938], [1072.800048828125, 944.6400146484375], [1083.4560546875, 850.1760864257812], [1187.1361083984375, 922.7520751953125], [3633.984375, 606.528076171875], [1082.4193115234375, 850.1761474609375], [1306.3681640625, 829.4401245117188], [1181.9521484375, 966.2977294921875], [1306.3682861328125, 828.6107788085938]] Now I need to …

python list loops indices
Python numpy array sum over certain indices

How to perform a sum just for a list of indices over numpy array, e.g., if I have an …

python numpy sum indices
How to use Hibernate @Index annotation properly?

i have a java class used as an entity that has 2 classes that inherit from it. this class has some …

java hibernate grails indices
Get even/odd indices of a matrix - MATLAB

I have following problem: I have a given matrix of let's say 4x4. How can I get the indices of …

matlab matrix indexing indices
Python equivalent of which() in R

I am trying to take the following R statement and convert it to Python using NumPy: 1 + apply(tmp,1,function(x) …

python r indices
numpy function to set elements of array to a value given a list of indices

I'm looking for a numpy function that will do the equivalent of: indices = set([1, 4, 5, 6, 7]) zero = numpy.zeros(10) for i in …

python numpy variable-assignment indices
C# rows of multi-dimensional arrays

In the C# programming language, how do I pass a row of a multi-dimensional array? For example, suppose I have …

c# arrays multidimensional-array row indices