Category "matrix"

Extract cells values of a matrix within a circle (in R)

In a matrix I would like to select a cell having a certain value (3 in the following example) and determine the number of cells having a value of 1 and 2, withi

R: how to calculate fraction of empty rows in all columns of a large matrix?

I'm working with single-nuclei rna sequencing and I made a matrix of a subset of genes across all features that shows the counts per gene for each of them. I wa

Initialising two large 2D array of 401X401 and do fast matrix multiplication in C++

I want to initialise two 2D matrices of size 401X401 and multiply them in a speedy way. But most probably due to stack overflow, two double 2D matrices were not

Trying to convert pandas df to np array, dtaidistance computes list instead

I am attempting to compute the distance matrix for an ndarray that I have converted from pandas. I tried to convert the pandas df currently in this format: move

R output matrix index with values in dataframe

I am trying to find the "matrix index" from values of dataframe in the Position column. The "matrix" that I would like to reference to is either a 3 x 3 or 4 x

More efficient way to get indices of a binary mask in Eigen3?

I currently have a bool mask vector generated in Eigen. I would like to use this binary mask similar as in Python numpy, where depending on the True value, i ge

Matrix multiplication by rearranging

I have a list of matrix dimensions like: (1, 2), (3, 2), (2, 3), (3, 1) I want to rearrange the matrix dimensions so that all of them can be multiplied. For the

PowerBI Field Formatting Section Not Showing for a Matrix Visualization

I have a simple PowerBI Matrix visualization and I need to justify columns left or right selectively. However, the Field Formatting section is not available or

Delta operator in sympy

Is it possible to make a delta operator like this in sympy? Im not really sure how to code it. Should be really eazy if there exists a method.

Neighbours does not yield true

I am writing a small program of how to calculate sum of neighbours of a given position in a grid. for some reason the program does not recognize the right value

Calculating the difference of all variables to all other variables

Suppose my Dataframe look like: w <- sample(-10:10, size =10) x <- sample(-10:10, size =10) y <- sample(-10:10, size =10) z <- sample(-10:10, size =

Python: Iterate through YAML file and output all relevant settings from hierarchy

I'm new to python and am looking for the best way to import a YAML file into Python and iterate through it to collect relevant appsettings for a specific instan

Compute Similarity(percentage) between two Matrix/Array

How to compute similarity(percentage) between two matrix/arrays. or find the closest array/matrix to a given array, on the basis of how similar their data value

How to create a matrix with key and value in java

I have this table with these values I have this code in java import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;

Transport modes/profiles in PTV developer Distance matrix API

I was planning to use PTV Developer API to calculate a distance matrix using something more sophisticated than a Manhattan distance. However looking at the Rou

How to decompose a 9x9 matrix to 3x3 matrices?

I'm trying to decompose a 9x9 matrix into 9 3x3 matrices. I've already used the command reshape, but the matrices it returns are the ones as transforming the co

Misconception regarding the matrix values e and f in svg

I seem to have a logical misconception, regarding the matrix of svg elements, specifically the parts e and f, which I hope someone can help me clarify. Basing o

Eigenanalysis of complex hermitian matrix: different phase angles for EIG and EIGH

I understand that eigenvectors are only defined up to a multiplicative constant. As far as I see all numpy algorithms (e.g. linalg.eig, linalg.eigh, linalg.svd)

How to make a vector of matrices in numpy

I would like to create a vector of the same matrix in numpy (so as an array). Let's say the matrix is: w = np.array([[1,2], [3,4], [

Singular Value Decomposition (SVD) outputs a 1-D singular value array, instead of 2-D diagonal matrix [Python]

I was posting a question on similar subject, and encountered another more important question. When I apply SVD to a matrix 'A' (code below) the output I get is