Questions tagged [binary-matrix]

54 questions
0
votes
0 answers

One million t-tests

I'm doing t-tests with multiple grouping variables (markers) which only have two groups (0 or 1). In the complete data there are a million grouping variables, eg n_obs = 1e+06, nvals=300, 5% NA. > n_obs = 1e+04 # to simulate grouping matrix > n_vals…
Sarah
  • 67
  • 1
  • 8
0
votes
1 answer

Find all possible combinations of binary m by n matrix

I want to create images whose dimensions are m by n. I need to create all possible images whose pixels are either black or white (no other colors for now). One way to go about this is to create binary matrices whose fields are either 0 or 1,…
Dennis Hackethal
  • 13,662
  • 12
  • 66
  • 115
0
votes
1 answer

Number of binary n x m matrices modulo c, with at most k consecutive number of 1 in each column

I am trying to compute the number of nxm binary matrices with at most k consecutive values of 1 in each column. After a few researches, I've figured out that it will be enough to find the vectors with 1 column and n lines. For example, if we have p…
0
votes
1 answer

Assigning ID's to Identical Rows in a Binary Matrix

I have a 1200x130 0-1 matrix and some of the rows are identical (4 from one row, 8 from another etc.). I am trying to find an efficient way to assign the same ID's to the identical rows. Here's what I've tried in Excel: For each row, I multiplied…
stgath
  • 1
-1
votes
1 answer

Binary heat plot in Python

I'm new to python and need help. I'm trying to produce a binary matrix (presence/absence) with the following data in a CSV format. I have tried several codes found in chats, but non of them solved the…
khady
  • 1
  • 1
-1
votes
1 answer

I am trying to find the number of rows that contain three or more 1s in a number of binary matrix csv files in the same directory?

I am looking for a way to find the number of rows consisting of three or more 1s in a number of binary matrices stored in individual .csv files in the same working directory. Is there a way in R to do such a thing? I have read in all the files in…
Jordan
  • 67
  • 2
  • 7
-1
votes
1 answer

Convert arules Transaction Data to an item matrix in R programming

I have a dataset with 100,000 rows in a transaction format as below B038-82C81778E81C Toy Story B038-82C81778E81C Planet of the apes B038-82C81778E81C Iron Man 9C05-EE9B44E8C18F Bruce Almighty 9C05-EE9B44E8C18F Iron Man 9C05-EE9B44E8C18F …
yadavabhishek
  • 17
  • 1
  • 4
-2
votes
1 answer

is there any way of '0's from arr[0][0] to arr[n][n]? (skewed is not allowed)

I was asked to solve a problem in advanced programming course that was "Say if there is any horizonal-vertical way of '0's in a 0 & 1 matrix from index[0][0] to index[n][n]?" and guided that can be solve by recursive function. In next session, the…
Reza
  • 1
-2
votes
2 answers

Creating a pytorch tensor binary mask using specific values

I am given a pytorch 2-D tensor with integers, and 2 integers that always appear in each row of the tensor. I want to create a binary mask that will contain 1 between the two appearances of these 2 integers, otherwise 0. For example, if the integers…
Codevan
  • 538
  • 3
  • 20
1 2 3
4