Developer FAQs

Developer Questions And Answers

×
MENU
  • Languages
  • Web
  • Database
HomematrixPosts
Convert a DataFrame into Adjacency/Weights Matrix in R Languages

Convert a DataFrame into Adjacency/Weights Matrix in R

I have a DataFrame, df. n is a column denoting the number of groups in the x column. x is a column containing the comma-separated groups.
01月24日 发表评论
Read More
How can I change the location of columns without using pandas Languages

How can I change the location of columns without using pandas

I have a matrix as shown below;And here's my code block:If a column full of A's, I want to move that column to the most right side, but my code moves all A's to right. This is my output:
12月28日 发表评论
Read More
Transform binary vector to binary matrix Languages

Transform binary vector to binary matrix

I have a binary vector that holds information on whether or not some event happened for some observation:
12月05日 发表评论
Read More
Deprecation status of the numpy matrix class Languages

Deprecation status of the numpy matrix class

What is the status of the matrix class in numpy? I keep being told that I should use the ndarray class instead. Is it worth/safe using the matrix class in new code I write? I don't understand why I should use ndarrays instead.
11月11日 发表评论
Read More
Numpy: Efficient way to convert indices of a square matrix to its upper triangular indices Languages

Numpy: Efficient way to convert indices of a square matrix to its upper triangular indices

Question: given a tuple of index, return its order in upper triangular indices. Here is an example:Suppose we have a square matrix A of shape (3, 3).
11月09日 发表评论
Read More
Diagonal snake filling array Languages

Diagonal snake filling array

Python 3.7. I'm trying to fill multidimensional array (n*m size) in diagonal-snake pattern:I have a function for n x n size and it works fine for it. But for n x m size it returns:
11月06日 发表评论
Read More
Find equal rows between two Matlab matrices Languages

Find equal rows between two Matlab matrices

I have a matrix index in Matlab with size GxN and a matrix A with size MxN. Let me provide an example before presenting my question.
10月03日 发表评论
Read More
Create matrix row-index which increments when rowsum > 100, and following row Languages

Create matrix row-index which increments when rowsum > 100, and following row

I have a matrix:I want to add a column with rows index. This index will starts at 1 and repeats the same index, until it arrived to a row where the rowsums is > 100 to move to the next value.
08月19日 发表评论
Read More
How to calculate the sum of “submatrix” entries with numpy/pandas? Languages

How to calculate the sum of “submatrix” entries with numpy/pandas?

I have the following 8x8 matrix in Python, which I have represented as either an 8-by-8 numpy array, or a pandas DataFrame:
08月14日 发表评论
Read More
Select entries of matrix based on given locations Languages

Select entries of matrix based on given locations

I have following matrix (MxN where M ≤ N):From each row, I want to select following column entries respectively (one per row):
08月03日 发表评论
Read More

Posts navigation

第 1 页 第 2 页
Copyright ©  Developerfaqs  All Rights Reserved.

登录 找回密码

输入用户名或电子邮箱地址,您会收到一封新密码链接的电子邮件。

  • 文章目录
  • icon