Category "multidimensional-array"

NRRD File of brain tumor is not being read into python with pynrrd module

I have nrrd files of the brain tumor. When reading the file into an array with a header and passing the code print(filename), I get an array of zeros. I checked

Traversing through a 2D array

I am trying to figure out how to traverse through a 2D array. The way in which I have been doing it is by using a nested for loop. I am curious to know of any o

Printing multiplication table using arrays and nested for loops

I am working on an assignment to create a multiplication table using a 2D array. This is what I came up with. 'use strict'; window.addEventListener('load',

Currently able to calculate total neighbors, I need just the neighbors that are alive

I have a bool [,] board that stores if the cell is alive or dead. The code I have provided is correctly telling me the total neighbors for each cell, the proble

Reshaping numpy array without changing the data

I'm trying to reshape an array of bitmap images that has a shape of (50,50,90000). How can I modify it so that I can get an array of (90000,50,50)? - I tried ar

Why do I get worse results in Java than in Python when using the same Tensorflow models?

Introduction: For education purpose I developed a Java class that enables students to load Tensorflow models in the Tensorflow SavedModel format and use them fo

Get "corners" of a 2d array

Alright, I've got a real stupid question. I have a two-dimensionial array of nullable integers. I wanna get the non-nullable corners of that array - so like, th

How do I detect and then base an action off of when one of my generated buttons(from a 2D button array) is clicked

So i am generating buttons like this and what i need to do is make those buttons disappear when they are clicked. { Button[,] buttonArray =

PHP array_search is very slow - how can i speed up?

I have two arrays one is a response from an API call where I get information about which email-addresses are already uploaded in the System -> $array_emails_

php Keeping only 1 date occurence in multi-dimensional array

I have this array with certain brand_ids, within these brands I have an array of dates in which a sale occured but these are based on the products in sale so th

Trouble with JavaScript 2D array and nested loop

Will you please explain what I'm missing? And possibly what I can do to fix it. I'm receiving the error: TypeError: Cannot set properties of undefined (setting

Why cant you subract a value from a for loop within an 2DArray but works vice versa(Adding a value to the 2DArray)?

Just like the game minesweeper I want the "O"s to change to "1"s if the borders are next to the "X"s, the board[i][j] will only change to "1"s if and only you a

How does the axis parameter from NumPy work?

Can someone explain exactly what the axis parameter in NumPy does? I am terribly confused. I'm trying to use the function myArray.sum(axis=num) At first I t

Selecting From multidimensional Numpy array with multidimensional mask

I am trying to build an example to understand image segmentation, you are given an image of shape (1,2,2,3) it's a 2x2 image where each pixel has 3 numbers indi

stack smashing detected when trying to get to typedef two dinatial array that the adress store inside struct

i have this typedef of two dinantial array, and strust the keep his adress typedef double mat[MAT_SIZE][MAT_SIZE]; typedef struct matList { char *name;

find unique lists inside another list in an efficient way

solution = [[1,0,0],[0,1,0], [1,0,0], [1,0,0]] I have the above nested list, which contain some other lists inside it, how do we need to get the unique lists i

How to change array rows places whithouth numpy

Hello everyone here is my code: n =[[34,2,55,24,22],[31,22,4,7,333],[87,74,44,12,48]] for r in n: for c in r: print(c,end = " ") print() sums=[]

concatenate arrays of different lengths into one multidimensional array

I know that you cant stack or concatenate arrays of different lenghths in NumPy as all matrices need to be rectangular, but is there any other way to achieve th

How to use dynamic 2d array inside a struct array in C?

What do I want to do? I'm working on a project on dynamic matrix multiplication. I want to input from the user that on how many matrices, he/she wants to perfor

Passing and Returning a 2D array of unknown size in C++

I want to pass and return a 2D array of unknown size but I donot know how to do it. I know how to only return array of unknown size only (array of pointers). I