Questions tagged [transpose]

Transposition is an operation that applies to matrices wherein the rows and columns are swapped

The transpose of a matrix A is written as A'. The transpose of matrix A is another matrix B in which the element in the ith row and the jth column of A is in the jth row and the ith column of B. For example:

Suppose A =

[[11, 12, 13],
 [21, 22, 23],
 [31, 32, 33]]

Then, A' =

[[11, 21, 31],
 [12, 22, 32],
 [13, 23, 33]]

In scientific software for statistical computing and graphics, function t transposes a matrix.

3257 questions
1
vote
1 answer

mysql, transpose/pivot row to column, variable selects

Hello again and thank you in advance for your help. I've checked a few prior questions and couldn't find this exact situation. I'm trying to transpose/pivot a row to column, but the results are based on a date function in the where clause, making…
alex
  • 113
  • 2
  • 13
1
vote
2 answers

How to merge arrays without overwriting its index in php?

I have this array Array ( [0] => Array ( [0] => Name [1] => Email [2] => Address ) [1] => Array ( [0] => vanson [1] => dhmax@pan.com [2] => gurgaon ) [2] => Array ( …
udgeet patel
  • 439
  • 1
  • 7
  • 23
1
vote
2 answers

What's the fastest way to convert a long list of int[16] to 16 long int[] in C#

I have a long (10000+ entries) List of structs, each of which contain an int[16]. I want to transpose the data to create 16 int[] arrays which are 10000+ entries long. Essentially, I want to transpose the data. Is there any method faster than…
reza
  • 1,329
  • 2
  • 22
  • 37
1
vote
1 answer

How to transpose MYSQL db in PHP

I am using PHP to query a MYSQL db to output data to a csv file. I am currently able to query the db and export the data to the CSV file. However i am unable to transpose the data so that the columns are rows, and rows are columns. CODE: function…
Merica
  • 129
  • 1
  • 11
1
vote
2 answers

Directly fetching a list from a column's data with MySQL

Let us suppose I have to deal with lots of grandmothers that have lots of cats. I have a table granny_cat : granny_id | kitty_name -------------------- 1 Kizzy 1 Jimmy 1 Katty 2 Georges 2 Albert 3 …
user151229
  • 13
  • 2
1
vote
0 answers

Java Matrix Transpose strangeness going on

ok so im making my own Matrix class. and i have a transpose method that transposes a matrix. this is the block in the main method Matrix m1 = new Matrix(4,2); m1.fillMatrix(1,2,3,4,5,6,7,8); System.out.println("before " +…
user1459976
  • 207
  • 6
  • 14
1
vote
2 answers

Transposing Table

I've looking everywhere and have not finding anything useful. I have a table the captures assistance for employees. The table that looks like this: ID | DATE | ATTENDANCE ________________ 2524 | 20121001 | ASISTANCE 2525 | 20121001 |…
zzzamo
  • 27
  • 1
1
vote
0 answers

How to modify only a certain part of a 2D array through a function?

I have a function which performs a transpose: transpose (int ** array, int arr_size){ for (i=0; i
Siddhartha
  • 4,296
  • 6
  • 44
  • 65
1
vote
1 answer

Rows to columns in SQL being one of the columns a count

Good afternoon, I am trying to use CASE like in this question to transpose rows to columns: Rows to columns SQL Server query However in my case I don't have a column with information it's a count of data. I obtain the data with this query: select…
Eduardo
  • 19,928
  • 23
  • 65
  • 73
1
vote
2 answers

How to use Pivot in SQL Server

I have table like this ID TimeStamp Statement Action 8082837636688904709 2012-07-23 16:03:25.000 UPDATE Skill name="French" SET state="1" 1 8082837636688904709 …
Trum
  • 71
  • 1
  • 9
1
vote
2 answers

Python/numpy append arrays, transpose, and save as csv

What I am doing: generating a series of long 1D arrays. What I want to do: append/concatentate/vstack/? these into a 2D array, then save the rows as columns in a csv file. The following works, but it's not elegant: rlist=[] …
dcnicholls
  • 391
  • 1
  • 5
  • 15
1
vote
3 answers

Excel Converting rows to columns with groups

Let's say that I have my columns in excel set up like this: Name A B C D George 10 5 4 6 And I want it to instead be like this: Name Category Amount George A 10 George B 5 George C …
BadgerBeaz
  • 383
  • 3
  • 7
  • 19
1
vote
1 answer

Rearranging data set in SAS

I am new to SAS and am trying to rearrange a dataset. I feel that it shouldn't be too hard but I've been struggling with it for quite some time now. Here is what my dataset looks like Factor Variable Value A X 1 A Y 2 B …
Marco
  • 1,472
  • 16
  • 29
1
vote
3 answers

Pivoting rows into columns in SQL Server

I have a set of data that looks like this: Before FirstName LastName Field1 Field2 Field3 ... Field27 --------- -------- ------ ------ ------ ------- Mark Smith A B C D John Baptist X …
supercoder
  • 107
  • 1
  • 2
  • 7
1
vote
2 answers

Excel Loop through list,transpose and create a matrix based on cell content

I am receiving a large file 500k+ lines but all the content is in column A. I need to run a macro that will transpose the data into matrix form but will only create a new row when it finds "KEY*" in the ActiveCell. For example: | KEY 4759839 |…
tehaaron
  • 2,250
  • 10
  • 31
  • 54