transpose

More Efficient Way to Avoid Multiple Calculations #3?

[亡魂溺海] 提交于 2020-01-24 20:14:36
问题 Looking for a more efficient way, possibly array formula for Min/Max down a column. Not sure if array formulas work with this function as I can't get it to. =ArrayFormula(MAX(INDIRECT("Data!E"&(K42:K169)&":E"&(K43:K170-1)))) =ARRAYFORMULA(MAX(VLOOKUP(K42:K169, {ROW(Data!A:A), Data!E:E}, 2, 0)&VLOOKUP(K43:K170-1, {ROW(Data!A:A), Data!E:E}, 2, 0))) Note that I am using ROW(Data!A:A) instead of simply ROW(A:A) because the range in current sheet doesn't fit that of sheet Data!. Here is my current

Transposing rows into columns based on a condition sql

a 夏天 提交于 2020-01-24 00:42:13
问题 I have a following table (a simplified example, in fact the table contains multiple IDs, with variable numbers of dates, and variable number of events for each date): IDs Date Event 102 1996-10-16 00:00:00 A 102 1996-10-23 00:00:00 A 102 1996-10-23 00:00:00 B 102 1997-01-14 00:00:00 A 103 1997-01-14 00:00:00 D 103 1997-01-15 00:00:00 A 103 1997-01-16 00:00:00 A 103 1997-01-16 00:00:00 B 103 1997-01-16 00:00:00 C I am trying to get a table where I will have distinct IDs/Date pairs, with the

Finding the transpose of a very, very large matrix

大兔子大兔子 提交于 2020-01-23 09:54:10
问题 I have this huge 2 dimensional array of data. It is stored in row order: A(1,1) A(1,2) A(1,3) ..... A(n-2,n) A(n-1,n) A(n,n) I want to rearrange it into column order A(1,1) A(2,1) A(3,1) ..... A(n,n-2) A(n,n-1) A(n,n) The data set is rather large - more than will fit on the RAM on a computer. (n is about 10,000, but each data item takes about 1K of space.) Does anyone know slick or efficient algorithms to do this? 回答1: Create n empty files (reserve enough space for n elements, if you can).

Memory efficient transpose - Awk

偶尔善良 提交于 2020-01-21 12:24:30
问题 i am trying to transpose a table (10k rows X 10K cols) using the following script. A simple data example $ cat rm1 t1 t2 t3 n1 1 2 3 n2 2 3 44 n3 1 1 1 $ sh transpose.sh rm1 n1 n2 n3 t1 1 2 1 t2 2 3 1 t3 3 44 1 However, I am getting memory error. Any help would be appreciated. awk -F "\t" '{ for (f = 1; f <= NF; f++) a[NR, f] = $f } NF > nf { nf = NF } END { for (f = 1; f <= nf; f++) for (r = 1; r <= NR; r++) printf a[r, f] (r==NR ? RS : FS) }' Error awk: cmd. line:2: (FILENAME=input FNR

Matrix formalism NxN adjacency matrix

守給你的承諾、 提交于 2020-01-17 15:23:44
问题 Let A be the NxN adjacency matrix of an undirected unweighted network, without self-loops. Let 1 be a column vector of N elements, all equal to 1. In other words 1 = (1, 1, ..., 1)T , where the superscript T indicates the transpose operation. Use the matrix formalism (multiplicative constants, multiplication row by column, matrix operations like transpose and trace, etc, but avoid the sum symbol Σ) to write expressions for: a)The vector k whose elements are the degrees ki of all nodes i = 1,

(VBA) Excel with thousands of rows - how to transpose variable length columns to rows?

↘锁芯ラ 提交于 2020-01-17 04:44:27
问题 I have an Excel sheet I am working with 9948 rows. A cell would have multiple pieces of information contained within it so what I've done so far is delimit those through Excel's text-to-column feature. (All data and column headers are arbitrary) It started out like this: ID | Name | Property1 | 1 Apple JO18, GFBAJH, HFDH, 78EA It has data (in mixed text/number format) in the first couple columns that should actually be on their own row. The amount of properties one of these have varies so one

How to transpose a table from columns to rows in Oracle sql [duplicate]

不问归期 提交于 2020-01-17 04:33:05
问题 This question already has answers here : Oracle SQL pivot query (2 answers) Closed 6 years ago . I have a table in sql which has a number of columns with the same type of data each column. I would like to transpose the table's columns into rows so that all of the data appears in 1 column. An example of the type of table I am talking about: ID DATE TEST_1 TEST_2 TEST_3 ---------------------------------------- 1 1jan12 98 66 77 2 2jan12 75 89 72 Into: ID DATE TEST SCORE ------------------------

MySql transpose multiple rows into column - the most optimized way for large data?

天大地大妈咪最大 提交于 2020-01-14 13:53:10
问题 i want to transpose multiple rows to column. This my table with data (about 20 mil.rows) PHONE SERVICE 0000000 service1 0000000 service2 0000000 service3 1111111 service1 1111111 service4 2222222 service5 and I would like to get the following output: PHONE SC1 SC2 SC3 SC4 SC5 0000000 service1 service2 service3 NULL NULL 1111111 service1 service4 NULL NULL NULL 2222222 service5 NULL NULL NULL NULL etc.. Anybody know the fastest to do this (for about 20mil records)? Thanks very much! 回答1: This

MySql transpose multiple rows into column - the most optimized way for large data?

回眸只為那壹抹淺笑 提交于 2020-01-14 13:51:08
问题 i want to transpose multiple rows to column. This my table with data (about 20 mil.rows) PHONE SERVICE 0000000 service1 0000000 service2 0000000 service3 1111111 service1 1111111 service4 2222222 service5 and I would like to get the following output: PHONE SC1 SC2 SC3 SC4 SC5 0000000 service1 service2 service3 NULL NULL 1111111 service1 service4 NULL NULL NULL 2222222 service5 NULL NULL NULL NULL etc.. Anybody know the fastest to do this (for about 20mil records)? Thanks very much! 回答1: This

Transpose and widen Data

こ雲淡風輕ζ 提交于 2020-01-13 19:17:11
问题 My panda data frame looks like as follows: Country Code 1960 1961 1962 1963 1964 1965 1966 1967 1968 ... 2015 ABW 2.615300 2.734390 2.678430 2.929920 2.963250 3.060540 ... 4.349760 AFG 0.249760 0.218480 0.210840 0.217240 0.211410 0.209910 ... 0.671330 ALB NaN NaN NaN NaN NaN NaN NaN NaN NaN ... 1.12214 ... How can I transpose it that it looks like as follows? Country_Code Year Econometric_Metric ABW 1960 2.615300 ABW 1961 2.734390 ABW 1962 2.678430 ... ABW 2015 4.349760 AFG 1960 0.249760 AFG