Category "multidimensional-array"

Perl: Multidimentional arrays and "experimental push" error

I'm a junior perl programmer and have very little experience with multidimentional arrays. I'm not even sure it is the proper data structure for this project. I

Sum column values from multiple arrays

I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique $loopThrice = 3; $getSum = 0; $total = array();

Sort multidimensional array by column value within a column

I have an array in PHP and I need to sort by a nested array inside of the array... Here is my array: Array ( [0] => Array ( [project_

Sum array values of a column within each column of an array with 3 levels

I'm trying to use array_sum() on columns within columns of a multidimensional array. For eg: I have an array that looks like this: $array = [ [['value' =>

How to remove from a multidimensional array all duplicate elements including the original?

I am using php 7.1. I have seen that to eliminate the duplicate elements it is enough with this array_unique($array, SORT_REGULAR); I've also seen this work ar

Group rows by column and sum another column within groups [duplicate]

I have an array looking like: array(480) { [0]=> array(2) { ["tag_id"]=> string(4) "6291" ["az"]=> int(5) } [

Two 2D array's of coordinates, finding if any of the coordinates from the different arrays are within a set distance of one another (python)

I have been trying to figure out how to make it so there is two 2D arrays, each containing a number of arrays that have x and y coordinates for set objects of t

Deleting a column from a multidimensional array in javascript

I have a 2D array: var array = [["a", "b", "c"],["a", "b", "c"],["a", "b", "c"]] I want to delete an entire column of this array (i.e. delete every third ele

Search for array row with specific column value and return another value from qualifying row

I have a multidimensional array that I am trying to search for a specific value (url) and then retrieve an another value in the same row (value). I also need to

2d array index out of range exception

As soon as i enter the while loop the program throws Index out of range exception, without getting rows and columns value. getint is a method to get user input

Insert database rows from columns of data from associative array of indexed arrays

I have an array called $works which looks like this: [ 'type' => [1, 5], 'description' => [2, 6], 'hours' => [3, 7], 'amount' => [4,

finding and replacing elements in a multidimensional list (python)

Similar to this question: finding and replacing elements in a list (python) but with a multi-dimensional array. For example, I want to replace all the N's with

How to change element in array?

Array is 2 dimensional 10x10 gameBoard Code I made for array: int gameBoardLength = gameBoard.length; System.out.print(" "); //two spaces to align t

To find Index of Multidimensional Array in Javascript

I have created a multidimensional array in JavaScript and I want to find the exact index of specific value. That value will be user input. var array = []; var k

Issue with Redim Preserve (2D array)

Yet another topic with multidimensional array and Redim Preserve, I know. I read a lot of them but still can not understand why my code is not working. I kwow

How to solve two dimensional growth grid problem?

I was doing an assessment for job interview. One of the 3 problems that I had to solve in an hour was finding the maximal value in a grid where you traverse it

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

I would like to take an array like this and combine it into 1 single array. array (size=2) 0 => array (size=10) 0 => string '1'

protocol buffers - store an double array, 1D, 2D and 3D

How can be an array of double (1D) stored using protocol buffer? What about multi-dimensional (2D or 3D) dense arrays?

How to construct a ndarray from a numpy array? python

I can't seem to convert it into an ndarray in numpy, i've read http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html but it didn't show me how

How do I initialize a two-dimensional List statically?

How can I initialize a multidimensional List statically? This works: List<List<Integer>> list = new ArrayList<List<Integer>>(); But