36,172 questions
Advice
0
votes
12
replies
146
views
Add item before a specific item in each item in array
Given
flat_array = ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'd', 'a', 'b', 'c', 'd']
, I would like to turn it into
['a', 'b', 'c', '|', 'a', 'b', 'c', '|', 'a', 'b', 'c', 'd', '|', 'a', 'b', 'c'...
Advice
0
votes
1
replies
51
views
Interpreting a FORTRAN 77 record declaration
I am rehosting an old FORTRAN 77 program from Solaris to LINUX, but due to extensive use of non-standard extensions, rehosting it as FORTRAN is impractical. I am re-writing it in C. I am struggling ...
Score of -3
2 answers
141 views
Why does my Java matrix multiplication method produce unexpected results for larger matrices? [closed]
I am practicing matrix operations in Java and trying to implement matrix multiplication using nested loops.
The method works correctly for some small matrices, but when I test larger matrices the ...
Score of 3
1 answer
207 views
"n error(s) in InterpolateAtPoint()NetCDS, ! cannot convert..." error when using stars::st_extract()
Context
I have a 3D datacube created by loading a NetCDS object using the stars package. This datacube represents a geographical 2D grid with (x ; y) indexes, and a third dimension representing time.
...
Score of -2
1 answer
190 views
How to return the data from first qualifying subarray in a multidimensional array [duplicate]
I'm writing a function where I try to get some configuration from an API call. The ID of the specific configuration is coming from a query string called id. A user can have different configurations, ...
Score of 0
0 answers
101 views
Foreach loop on a multi-dimensional PHP array returns complete wrong results [duplicate]
I have a fairly straightforward MYSQL query which retrieves details from a sale and stores them in an array (I've simplified it by just using 1 saleid which has only 1 salesdetails row - other sales ...
Score of -2
3 answers
244 views
Transform Nested List of Matrices into 4D Array
Background
I am developing an R program that hierarchically tabulates data in the command line. In the spirit of cli and its box-styles, I have created a nested list with the appropriate box-drawing ...
Score of 2
1 answer
185 views
Random growth algorithm not working as intended
For a game I'm working on, I'm starting with an 8x8 int array with all values zero. Then I'm randomly placing a single non-zero value in each row/column in such a way that there's only a single non-...
Advice
0
votes
3
replies
92
views
How to make a 3D plot from a 3D numpy array
I would like to make a 3D surface plot (ideally like the one seen here https://matplotlib.org/stable/gallery/mplot3d/contour3d_3.html) from a 3D array.
How do I take one 3D array and create the three ...
Score of 3
1 answer
99 views
2D fourier transform gone wrong ,where am I wrong?
I used to do audio sampling but now I have moved into images.I am trying to implement the discrete fourier transform for a image(16x16 bits).
I have created my own image decoder.Every file contains ...
Advice
1
vote
10
replies
102
views
Adding or having an mathematical operational function using arrays?
Hello!
I'm sorry if it may sound dumb but I'm still learning java as it's the first thing that we are currently learning in university. We are now discussing arrays and I'm a bit confused how to do ...
Score of 0
0 answers
38 views
PHP array split at brackets into new Multidimensional array [duplicate]
I have data from a file that is in the below format with 100's of entries with each [Person_X] containing different amounts of data and am trying to convert this to a nested/multidimensional array ...
Advice
0
votes
18
replies
269
views
Excel VBA Copying large array into table takes very long
I have some problems with adding data from an array into an table. I have attached the code of my test program.
Test setup:
Empty Excel table with 34 columns and 1 row
I create a variant array with ...
Score of -1
1 answer
76 views
What is the correct syntax to use a javascript variable to use as a pointer in a multidimensional associative array? [duplicate]
I'm new to this, and could use some guidance.
I have a 2 dimensional associative array that is passed from PHP to javascript using JSON and I am trying to access the array in javascript using the ...
Score of 2
3 answers
139 views
Finding unique 1D arrays and corresponding 2D index pairs in 3D array (with numpy)
I have a 3D numerical array X, of shape=(N,N,6); and a 2D logical array mask, of shape=(N,N). I would like to find all unique 1D subarrays (length=6, along axis=2) of X, searching over the first two ...