3,403 questions
0
votes
2
answers
74
views
Add column with row values based on a category to R dataframe
so I have a dataframe of the following structure, let's call this one df0:
year
category
a
b
c
d
1989
1
0.3
0.7
0.43
321
1989
1
0.3
0.7
0.43
321
1989
2
0.2
0.4
0.5
174
1989
2
0.2
0.4
0.5
174
1989
2
0....
1
vote
2
answers
171
views
Tranpose of a matrix
I am trying to find the transpose of a given matrix A with rows rows and cols columns.
My try:
void GetTranspose(int* a, int rows, int cols, int* tr)
{
for (int i = 0; i < cols; i++)
{
...
0
votes
1
answer
562
views
Snowflake - How to pivot 2 or multiple columns without aggregation
I am new to snowflake and I have a scenario with table having below data,
Combined1 Combined2 Common_code
Name John ABC123
City NY ABC123
Sex M ABC123
Country ...
0
votes
1
answer
51
views
Using Pandas to stack a data frame in a specifc format
I have a panas dataframe as follows:
df
Prod ProdDesc tot avg qtr val_qtr
A Cyl 110 8.7 202301 12
A Cyl 110 8.7 202302 56.9
A ...
1
vote
1
answer
144
views
Transpose dataframe in R and maintain first column
I need to transpose a dataframe in R, making the first column the headers of the transposed df, and the current columns headers the values in column 1 of the df. Like this -
df =
| |S1|S2|S3|
1|A|1 ...
1
vote
1
answer
34
views
Python Dataframe: Transpose 4/5 Columns in a Dataframe And Hold Date Column Without Transposing
I have a sample input dataframe:
Name
Date
Score
Target
Difference
Jim
2023-10-09
9
12
3
Jim
2023-10-16
13
16
3
Andy
2023-10-09
7
7
0
Andy
2023-10-16
5
20
15
Python code to create table:
import pandas ...
0
votes
1
answer
128
views
python-polars transpose on the column of lists
I have a data frame with an index column and column with a list of values (lists could be different length):
df2 = pl.DataFrame({'x': [1, 2, 3], 'y': [['a', 'b', 'c'], ['d', 'e', 'f', 'g'], ['h', 'i', ...
0
votes
0
answers
76
views
Problems while printing out transposed matrix
My problem is that after printing out 1st row of matrix after transposing im receiving an error telling me that im trying to access not accessible location
First post with asm discussion if i didnt ...
0
votes
2
answers
160
views
Transpose data from different rows to the same column, but at a regular interval, using Python (or Power Query)
So, I have a .xlsx dataset which I call the "source" dataset.
The "source" dataset has hundreds of lines with information about quantity of insects per species.
The header of each ...
-1
votes
1
answer
803
views
Transposing Columns to Rows Using only Case Statement and Joining All Tables
I have a query that produces millions of rows and has 10s of columns. I have posted a pic of the original query and it's a simplied version of what I am working with and is named 'Details'.
I need to ...
0
votes
1
answer
58
views
How to transpose columns into rows and ensure repetition of rows accordingly in R? [duplicate]
How to transpose the columns and ensure that rows are repeated accordingly?
Dataset df has the following data :-
Date Year Month Day USD EUR JPY
1994-1-1 1994 1 1 10 20 5
1995-1-1 ...
0
votes
1
answer
125
views
Problems with pointers in asembly function transposing matrix
In my code im trying to transpose dynamic matrix (IN64) using function written in assembly
It seems that im trying to read from outside of matrix or i`m making a mistake while trying to point from ...
1
vote
1
answer
51
views
Pivot_wider with Known Duplicates that Need to Stay
I have data with participants that have multiple rows assigned to their id and I am trying to get them all on one line. This is because the contact type column has their phones and emails on each line....
0
votes
1
answer
112
views
how to transpose row to columns sequentially with SQL in MS ACCESS database
I'm trying to transpose row to columns sequentially with SQL in MS ACCESS database . I have the SQL below, but it's not right yet:
I want in one query.
If there is an answer then I don't want to use ...
0
votes
2
answers
143
views
Transform data frame in R [duplicate]
I need some advice about which package command I can use in R to get from df to df2:
data frame called df where:
ex this is the head of df:
GeneIndex SampleIndex tpm GeneID GeneName
<int> &...
0
votes
0
answers
146
views
VBA Cut Paste Transpose - Repeat
I am looking to write a script so I can put a button on an evaluation form that will pull a range (for example: name, title, income) from another file or worksheet. Each time the macro button is ...
1
vote
4
answers
188
views
Tranposing dataset in excel
May I know how to transpose this data into the format I want in excel
The current method I had done is manually copy and paste, but i have to convert from a 15 rows x 6 columns data into a 3 rows x ...
3
votes
4
answers
13k
views
Excel function to transpose every nth row into columns
I have a sheet with a large row of data but the relevant data are every 3rd row
In Sheet1
Col A
First
Second
Third
Fourth
Fifth
Sixth
Seventh
In Sheet2, I would like to transpose the relevant rows to ...
4
votes
1
answer
683
views
How to transpose a 8x8 int64 matrix with AVX512
Consider 8 AVX512 registers containing rows of a matrix, so that each 64-bit lane is a cell of an 8x8 matrix. How to transpose such a matrix in C/C++?
What I have tried so far: 8 ...
1
vote
1
answer
83
views
Why does .reshape(a, b) != .reshape(b, a).T?
I ran into this problem whilst flattening images. Consider the following array
>>> import numpy as np
>>> arr = np.array([[[1, 2],
[3, 4]],
[[...
0
votes
1
answer
44
views
Is there an easy way to get the transpose of a data frame while grouping the values of one of their columns? [duplicate]
I have the following data frame:
df <- data.frame(group = c("A","A","A","B","B","C","C","C"),
year = c(&...
1
vote
2
answers
41
views
Transpose DataFrame of 2 columns in R, in which 1 column has all the observations
my data frame has in the first column repeated labels, and in the second column all the observations. Its like a data frame made of multiple stacked data frames
Something like this:
Labels
...
0
votes
0
answers
42
views
Excel columns to rows trasnpose
I have this downloaded data in excel
I want to convert that data into this format so that i can calculate % diff across the months
0
votes
1
answer
56
views
How to match data to specified rows and columns in R (or transpose data with matching)
I had multiple datasets with information about the day shift in the company like this:
Day1Set
name shift work_time
Worker1 1 8
Worker3 1 6
...
Day2Set
name shift work_time
Worker2 2 ...
0
votes
1
answer
84
views
Sum values based on three criteria and transpose result from tabular to visual layout
I'm trying to summarize values found in column "O" of my sourceSheet based on the strings of three columns.
One of the columns (sourceSheet "A") is a Year-Month string, and the ...