tagged [multidimensional-array]

Two dimensional array in python

Two dimensional array in python I want to know how to declare a two dimensional array in Python. The first two assignments work fine. But when I try to do, `arr[1].append("bb1")`, I get the following ...

12 Oct at 04:53

Span and two dimensional Arrays

Span and two dimensional Arrays Is it possible to use the new [System.Memory Span struct](https://msdn.microsoft.com/en-us/magazine/mt814808.aspx) with two dimensional arrays of data? ``` double[,] te...

Calculate mean across dimension in a 2D array

Calculate mean across dimension in a 2D array I have an array `a` like this: I need to calculate the mean for each dimension separately, the result should be this: `45` being the mean of `a[*][0]` and...

How to get a complete row or column from 2D array in C#

How to get a complete row or column from 2D array in C# I do not want to use a jagged array and I have a 2D array and I want to get a complete column or row without looping through it. Does anyone hav...

6 Aug at 15:16

Convert a 1D array to a 2D array in numpy

Convert a 1D array to a 2D array in numpy I want to convert a 1-dimensional array into a 2-dimensional array by specifying the number of columns in the 2D array. Something that would work like this: D...

Selecting specific rows and columns from NumPy array

Selecting specific rows and columns from NumPy array I've been going crazy trying to figure out what stupid thing I'm doing wrong here. I'm using NumPy, and I have specific row indices and specific co...

Why do C# multidimensional arrays not implement IEnumerable<T>?

Why do C# multidimensional arrays not implement IEnumerable? I have just noticed that a multidimensional array in C# does not implement `IEnumerable`, while it does implement `IEnumerable`. For single...

19 May at 11:12

Matrix Transpose in Python

Matrix Transpose in Python I am trying to create a matrix transpose function for python but I can't seem to make it work. Say I have and I want my function to come up with So in other words, if I were...

24 Apr at 19:50

Loop over array dimension in plpgsql

Loop over array dimension in plpgsql In plpgsql, I want to get the array contents one by one from a two dimension array. But the above code returns: in one line. I want to be able to loop ov

Transforming a row vector into a column vector in Numpy

Transforming a row vector into a column vector in Numpy Let's say I have a row vector of the shape (1, 256). I want to transform it into a column vector of the shape (256, 1) instead. How would you do...

push() a two-dimensional array

push() a two-dimensional array I'm trying to push to a two-dimensional array without it messing up, currently My array is: And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //st...

Javascript Map Array Last Item

Javascript Map Array Last Item I have this: It maps through a 2-dimentional array. After each row, I'd like to insert ``. I think, if I could somehow get the last index for each row, so I will be able...

Reading from Excel (Range into multidimensional Array) C#

Reading from Excel (Range into multidimensional Array) C# How would I read from an Excel sheet and load the marked selection (Area) into an multidimensional array? A column in Excel could itself be a ...

20 Sep at 14:49

How do you get the width and height of a multi-dimensional array?

How do you get the width and height of a multi-dimensional array? I have an array defined: This is all well and good, but I need to know how wide this array is in the `x` and `y` dimensions individual...

17 Aug at 16:59

Initializing multidimensional arrays in c# (with other arrays)

Initializing multidimensional arrays in c# (with other arrays) In C#, it's possible to initialize a multidimensional array using constants like so: I personally think initializing an array with hard c...

Iterating over a 2 dimensional python list

Iterating over a 2 dimensional python list I have created a 2 dimension array like: Printing this list gives an output: where each list item i

18 Jun at 17:3

C# Arrays - string[][] vs. string[,]

C# Arrays - string[][] vs. string[,] > [What is differences between Multidimensional array and Array of Arrays in C#?](https://stackoverflow.com/questions/597720/what-is-differences-between-multidime...

23 May at 12:32

Convert multidimensional array to jagged array in C#

Convert multidimensional array to jagged array in C# I have a C# WCF webservice which is called by two VB 6 project. The target VB project is sending to the client VB project a multidimensional array....

Multi-dimensional array vs. One-dimensional

Multi-dimensional array vs. One-dimensional This is basically a restatement of this question: [Java: Multi-dimensional array vs. One-dimensional](https://stackoverflow.com/questions/2512082/java-multi...

How do I 'foreach' through a two-dimensional array?

How do I 'foreach' through a two-dimensional array? I've got a two-dimensional array, And I'd like to `foreach` through it like this, But, I get the error: > Can't convert

7 May at 14:35

Creating an array of two-dimensional arrays in C#

Creating an array of two-dimensional arrays in C# I simply want to create an array of two dimensional arrays to store coordinate points. So I want an array where each index returns a two dimensional a...

How do I iterate through each element in an n-dimensional matrix in MATLAB?

How do I iterate through each element in an n-dimensional matrix in MATLAB? I have a problem. I need to iterate through every element in an n-dimensional matrix in MATLAB. The problem is, I don't know...

Multi-dimensional arrays in Bash

Multi-dimensional arrays in Bash I am planning a script to manage some pieces of my Linux systems and am at the point of deciding if I want to use [bash](/questions/tagged/bash) or [python](/questions...

Submitting a multidimensional array via POST with php

Submitting a multidimensional array via POST with php I have a php form that has a known number of columns (ex. top diameter, bottom diameter, fabric, colour, quantity), but has an unknown number of r...

Using Linq with 2D array, Select not found

Using Linq with 2D array, Select not found I want to use Linq to query a 2D array but I get an error: > Could not find an implementation of the query pattern for source type 'SimpleGame.ILandscape[]'....

19 Jul at 15:31