I am carrying out a series of calculations using the sqrt() function. My colleagues and I have noticed that we get different results when using the same inputs. Has anyone encountered this problem before? This is an example: input1 = 4; input2 = 8; result = sqrt(input1^2 + input2^2) Result...

I am trying to use Pandas to represent motion-capture data, which has T measurements of the (x, y, z) locations of each of N markers. For example, with T=3 and N=4, the raw CSV data looks like: T,Ax,Ay,Az,Bx,By,Bz,Cx,Cy,Cz,Dx,Dy,Dz 0,1,2,1,3,2,1,4,2,1,5,2,1 1,8,2,3,3,2,9,9,1,3,4,9,1 2,4,5,7,7,7,1,8,3,6,9,2,3 This is really simple to load into a DataFrame,...

I want multiple indices to be under one name.. How can i do that in kibana... as shown in this picture..so that the logs ( app,server,db) of the server1 and the logs of server 2 under it. How can we customize to make multiple indices under one name. { http://i.stack.imgur.com/t3eV8.png...

Given a vector such as a = [2 5 9] and a matrix such as 8 11 5 b = 2 6 1 4 9 3 What's the best way to find which column of b contains each element of a? In this example I'd want an output like [1...

(No, this is not a homework assignment nor a contest, even though it might look like one.) I have a list A in Python that contains the numbers range(0, len(A)). The numbers are not in order, but all of them exist in the list. I'm looking for a simple way...

I think my understanding of callbacks is pretty green. But this is what have so far and my function is only adding the first index in each array together. var merge = function(array1, array2, callback){ for (var i = 0; i < array1.length; i++) { return array1[i] + array2[i]; };...

I've been having this very annoying problem for the past weekend. I have to be able to to read in a triangulated 2014 FBX file that contains a mesh exported from Maya and read in it's vertices and indices to be passed to the renderer (DirectX) for the DrawIndexed call....

Can I use numpy to generate repeating patterns of indices for example. 0, 1, 2, 3, 4, 5, 0, 6, 7, 8, 9, 10, 0, 11, 12, 13, 14, 15 or 0,1,2,1,2,3,4,5,6,5,6,7 Is there a method in numpy i can use to generate these lists between a range ? currently...

I am trying to write a program that will take a file and encode it using the Viginère cipher. I've run into a little bump with indices. I've defined my strings text and alphabet like this: import string alphabet = string.ascii_lowercase ciphertext = open("black_hole.txt","r") ciphertext = ciphertext.read() text = ""...

Suppose we have a matrix that looks as follows: -0.3 0.2 0.001 -0.4 0.5 0.25 0.45 0.2 -0.001 0.02 0.8 - 0.2 0.35 0.1 0.1 0.25 -0.14 -0.1 0.02 0.4 Now I want to find that part of the matrix which has dimension 2 x 2 AND has the largest...

In matlab I have the following 2 data structures b and c defined as follows. b(1).b = struct('c',{'a', 'b', 'c'}) c(1).b = struct('c',{'b', 'a', 'c'}) Now I want to use ismember to find out if the elements of b(1).b.c are contained in c(1).b.c and if so, which indices of c(1).b.c...

Why can't I index an ndarray using a list of tuple indices like so? idx = [(x1, y1), ... (xn, yn)] X[idx] Instead I have to do something unwieldy like idx2 = numpy.array(idx) X[idx2[:, 0], idx2[:, 1]] # or more generally: X[tuple(numpy.vsplit(idx2.T, 1)[0])] Is there a simpler, more pythonic way?...

I have a list which looks like: [[0,1,2], [1,2,3], [2,3,4], [3,4,5]] I can make it to an array like: array([[0,1,2], [1,2,3], [2,3,4], [3,4,5]]) So all together I have 4 rows and each row has 3 columns. Now I want to find the indices of all the elements which are greater...

Having matrix A (n*2) as the source and B as a vector containing a subset of elements A, I'd like to find the row index of items. A=[1 2;1 3; 4 5]; B=[1 5]; F=arrayfun(@(x)(find(B(x)==A)),1:numel(B),'UniformOutput',false) gives the following outputs in a cell according to this help page [2x1 double] [6]...

In R I'm trying to figure out how to select multiple values from a predefined vector of sequences (e.g. indices = c(1:3, 4:6, 10:12, ...)). In other words, if I want a new vector with the 3rd, 5th, and 7th entries in "indices", what syntax should I use to get...

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],...

I am trying to make a function that will take a character and a histogram and add an instance of that character to the histogram. My code so far is like this: def add_to_hist(character, histogram): """Takes a character and a histogram and adds an occurrence of that character to the...

In C# is it possible to have an Indexer property of a type that is not a string or an int? For example I have a custom object that is a map of 2D vector coordinates. Taking the basics of my map class to be... public class TileMap { ///...

Consider this fully working code: #include <type_traits> template <typename T, typename IndexPack> struct Make; template <typename T, template <T...> class P, T... Indices> struct Make<T, P<Indices...>> { using type = P<(Indices+1)..., (-3*Indices)..., (Indices-1)...>; }; template <int...> class Pack; int main() { static_assert (std::is_same<Make<int, Pack<1,2,3,4>>::type, Pack<2,3,4,5, -3,-6,-9,-12, 0,1,2,3>>::value, "false"); } What...

I convert a list of integers to a two dimensinal array like this: data = numpy.array( l ) shape = ( 10, 30 ) data = data.reshape( shape ) I try to get the indices x,y of the matrix of the values that are bigger than some threshold and lower...