Category "matrix"

Matching and indexing through two dataframes and one matrix

I have a dataframe events with xy-coords of unique points. I have a dataframe all_nodes with xy-coords of network nodes. All points of events are also in all_no

Sampling submatrices in R

Given a matrix like mat > set.seed(1) > mat <- matrix(rbinom(100,1,0.5),10,10) > rownames(mat) <- paste0(sample(LETTERS[1:2],10,replace=T),c(1:nr

How can I generate a 2D matrix of natural numbers wth zero in ascending order in shell script or another programming language?

I need to generate matrices of natural numbers in ascending order with zero (0), but they are very large ones and it will be hard to write them by hand. What I

Coerce R matrix to dgTMatrix inside a function

Given a matrix object in R, it's easy to coerce it to a sparse matrix in triplet format: library(Matrix) m <- matrix(rbinom(100,1,0.5),10,10) m <- as(1*m,

how to create a 3D matrix in a loop , where in each loop the matrix size might change?

i wrote this code where i have array of matrics(alpha_mom_DR_data_array), and in this array , there are matrics in different sizes , for each one i want to calc

Grid from a set of arrays - how to cut execution time?

I have a wide set of splines, and at each point (x,z) of these splines is associated to a field value. I need to map all these points and relevant field values

Moore-Penrose Pseudoinverse of matrix using Singular Value Decomposition

I am trying to compute the pseudoinverse of a matrix in C code. Specifically, I am trying to compute the Moore-Penrose pseudoinverse using singular value decomp

Unmask data from matrix linux shell

i have 2 file. analizeddata.txt: A001->A002->A003->A004 A001->A005->A007 A022->A033 [...] and matrix.txt: A001|Scott A002|Bob A003|Mark A004|

Calculating a matrix to invert a "flattened" 3D rendering context

Context: In my web app I create several groups of elements all positioned relative to each other in 3d space. All elements have transform-style: preserve-3d. A

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 =