Questions tagged [arrays]
An array is an ordered linear data structure consisting of a collection of elements (values, variables, or references), each identified by one or more indexes. When asking about specific variants of arrays, use these related tags instead: [vector], [arraylist], [matrix]. When using this tag, in a question that is specific to a programming language, tag the question with the programming language being used.
arrays
417,775
questions
4
votes
2
answers
2k
views
deleting rows of a numpy array based on uniqueness of a value
let's say I have a bi-dimensional array like that
numpy.array(
[[0,1,1.2,3],
[1,5,3.2,4],
[3,4,2.8,4],
[2,6,2.3,5]])
I want to have an array formed eliminating whole rows based on ...
57
votes
10
answers
31k
views
Why are multi-dimensional arrays in .NET slower than normal arrays?
Edit: I apologize everybody. I used the term "jagged array" when I actually meant to say "multi-dimensional array" (as can be seen in my example below). I apologize for using the incorrect name. I ...
2
votes
4
answers
2k
views
Sorting an array of arrays by the child array's length?
What's the best way in PHP to sort an array of arrays based on array length?
e.g.
$parent[0] = array(0, 0, 0);
$parent[2] = array("foo", "bar", "b", "a", "z");
$parent[1] = array(4, 2);
$sorted = ...
75
votes
3
answers
53k
views
What is the max key size for an array in PHP?
I am generating associative arrays and the key value is a string concat of 1..n columns.
Is there a max length for keys that will come back to bite me? If so, I'll probably stop and do it differently....
40
votes
6
answers
124k
views
Array of Matrices in MATLAB
I am looking for a way to store a large variable number of matrixes in an array in MATLAB.
Are there any ways to achieve this?
Example:
for i: 1:unknown
myArray(i) = zeros(500,800);
end
Where ...
1
vote
2
answers
9k
views
Flex Datagrid to Array?
I need to convert a datagrid table in Adobe Flex to an ArrayCollection. I was expecting to be able to loop through each row of a datagrid and write that to the Array collection, but the only method ...
2
votes
3
answers
4k
views
How to assign values to the whole row of a dynamic two dimensional array?
I need to perform 9 different operations on a coordinate, depending on the position of the coordinate. I have a function that returns the coordinates of a position around the given coordinate (down, ...
2
votes
2
answers
15k
views
How do I extract byte array from soapUI response?
I am testing a web service with soapUI. One of the responses looks like this:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:...
2
votes
7
answers
985
views
Looping through an array without throwing exception
Say I have an array of values:
string[] text = new string[] { "val1", "val2", "val3", "val4", "val5" };
Then I have a basic loop:
for (int i = 0; i <= 30; i++)
{
Console.WriteLine(i + " = " +...
47
votes
2
answers
76k
views
Can I get the matrix determinant using Numpy?
I read in the manual of Numpy that there is function det(M) that can calculate the determinant. However, I can't find the det() method in Numpy.
By the way, I use Python 2.5. There should be no ...
1
vote
4
answers
4k
views
Copying lines from stdin to an array of character pointers
I would like to copy lines from stdin to an array of character pointers. For example if the user entered the following "the\nquick\nbrown\nfox" then I would like to have an array that looks like
...
19
votes
5
answers
69k
views
Put result of String.Split() into ArrayList or Stack
I am using the String.Split() method in C#. How can I put the resulting string[] into an ArrayList or Stack?
41
votes
9
answers
94k
views
Convert a multidimensional javascript array to JSON?
What is the best way of converting a multi-dimensional javascript array to JSON?
0
votes
3
answers
136
views
Searching for and matching elements across arrays
I have two tables.
In one table there are two columns, one has the ID and the other the abstracts of a document about 300-500 words long. There are about 500 rows.
The other table has only one ...
0
votes
3
answers
833
views
VB.NET Problem with "Control Arrays"
I have a VB.NET application and use some third party (closed source) ActiveX controls. One of the controls represents a "camera" (connected over several interfaces) and I try to write an example how ...