I have a 5 x 600,000 matrix. I've had an idea to group the data so I want to group this matrix into submatrices based on the values in column 4. For ...

How do I split a very large matrix into submatrices based on the value in a column?

I have a 5 x 600,000 matrix. I've had an idea to group the data so I want to group this matrix into submatrices based on the values in column 4. For ...

Is there a way to multiply non-conformable arrays using 0 for missing values in R?

I am trying to figure out a way to multiply non-conformable arrays element-wise. I think this is a simple task, but I keep having problems. I have tw ...

How do I sort columns in a Matrix view?

I am attempting to create a gantt chart in Power Bi using the matrix view, and the end user wants it to have year, quarter, and month. The year and qu ...

Populating Matrix with for loop in R (count and sum)

I already asked a related question here, which was probably not sufficiently specified and thus the answers did not solve my problem. Will try to do i ...

Merge header columns in a matrix in bash but keeping columns that have value in same row separate

I want to merge the headers of the matrix (FS is tab): like this: I tried this but it forms the following table which is not desired: ...

Splitting a matrix by both rows and columns using asplit() in R

Consider the following fake example where I extract all comparisons corresponding to a name called A from a matrix called matr. The above implement ...

Merge header columns in a matrix in bash

I want to merge the headers of the matrix: like this: I tried this and it didn't work (and it wasn't actually applicable to the larger matrix: ...

Populating a Matrix by doing Calculations along the Diagonal

I have a matrix n*n with values along its diagonal. I would like to create a new matrix by multiplying elements of the diagonal matrix b, correspondin ...

Finding combination of NAs in matrix (exclusive AND?)

I am faced with a problem I cannot quite figure out and I hope that someone might be able to help me with this. Its probably super easy but I am strug ...

Reduced Row Echelon Implementation in Java

. Answers to this question are eligible for a +200 reputation bounty. L ...

np.array for variable matrix

It has this error. May I know how to fix it, please? I mean do not change the elements in the data. Many thanks. I made the matrix in the same ...

Retrieve per-document topic based on largest probability from LDA gensim

I have an LDA model where I've got the per-document topic probability matrix as per below. How do I extract the topic ID with the largest probabili ...

convert multiple rows to columns in pandas dataframe with calculations

i have the following data frame df columns: cell, cond_one, cond_two, pvt: string type value : float64 type i want to create columns based up on ...

python apply a function with two arguments to alla element of a matrix

let's say that I have the following function I know how to apply it to one element of a matrix: I would like now to apply it to all the element ...

Row reducing a matrix (not using sympy.rref)

I have a matrix, G (size PxN), and I would like to make the first N/2 columns of G form the N/2×N/2 identity matrix by row operations. Any idea how I ...

Convert a vector to a symmetric hollow matrix in Matlab

I would like to convert a vector to a symmetric hollow matrix but I am not really familiar with Matlab. For example: r2 = randi(10,276,1); and co ...

Plot a 3d plot in Python from elements in a 2D matrix

I would like to plot a function f(x1, x2) of two variables x1 and x2 in a 3D plot. The function is containted in a 2D matrix, with x1 forming the rows ...

Reading a matrix from a file in C, the file contains values and positions

Hi I am CS student with no prior experience in programming, my teacher gave me this exercise which involves reading a file like this: 3 4 2 1 1 1 2 3 ...

How to sum R matrix value

I need to loop through the following matrix and sum up values in each position where the column index or row index is equal to the value at the positi ...

Create a matrix out of table using awk

I want to use this table: and make this matrix by using awk (or any other simple option in bash): I tried this but it didn't work: ...

Sorted:

Quality: