Tag: multidimensional-array

57 votes
8 answers
403 views
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

avatar
Chaya
0 1 0 9
asked 07 September, 2021
53 votes
5 answers
2.6K views
What is the difference between ndarray and array in numpy?

What is the difference between ndarray and array in Numpy? And where can I find the implementations in the num

avatar
Majorie
0 1 0 9
asked 07 September, 2021
54 votes
3 answers
2.6K views
What is the difference between flatten and ravel functions in numpy?

import numpy as np y = np.array(((1,2,3),(4,5,6),(7,8,9))) OUTPUT: print(y.flatten()) [1 2 3 4 5 6

avatar
Arline
0 1 0 9
asked 07 September, 2021
54 votes
7 answers
1.3K views
Difference between numpy.array shape (R, 1) and (R,)

In numpy, some of the operations return in shape (R, 1) but some return (R,). This will make matrix multiplica

avatar
Solomon
0 1 0 9
asked 07 September, 2021
69 votes
7 answers
441 views
What is the purpose of meshgrid in Python / NumPy?

Can someone explain to me what is the purpose of meshgrid function in Numpy? I know it creates some kind of gr

avatar
Yolando
0 1 0 9
asked 07 September, 2021
47 votes
30 answers
797 views
How to count the occurrence of certain item in an ndarray?

In Python, I have an ndarray y that is printed as array([0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1]) I'm trying

avatar
Lynette
0 1 0 9
asked 07 September, 2021
62 votes
20 answers
902 views
How to make a flat list out of a list of lists

Is there a shortcut to make a simple list out of a list of lists in Python? I can do it in a for loop, but is

avatar
Karolyn
0 1 0 9
asked 07 September, 2021
54 votes
8 answers
412 views
PHP - Merging two arrays into one array (also Remove Duplicates)

Hi I'm Trying to merge two arrays and also want to remove duplicate values from final Array. Here is my

avatar
Keila
0 1 0 9
asked 07 September, 2021
58 votes
14 answers
2.2K views
How to Sort a Multi-dimensional Array by Value

How can I sort this array by the value of the "order" key? Even though the values are currently sequential, th

avatar
Nereida
0 1 0 9
asked 07 September, 2021