Skip to main content

Questions tagged [reshape]

In R, Matlab, NumPy and APL, reshape functions allow data to be transformed into more convenient forms.

0 votes
0 answers
13 views

Reshape LSTM Layer Input Tensorformat

I have a table with 4700 rows and 50 columns. The last 3 columns should be predicted. How do I have to set up my X and my y to be able to enter it in an LSTM layer? X = (?, ?, ?) y = (?, ?) I ...
Jumpstar's user avatar
0 votes
0 answers
16 views

How do I reshape the pythonarrays as input and output for a convolutional neural network in Keras4Delphi properly

I'm working on a Speech2Vec algorithm with 3 neural networks. The first of these networks is for speech recognization. It converts a single FFT window (one dimensional) to 'sound nrs.': 1..1500. So I ...
RoelsRule's user avatar
4 votes
3 answers
107 views

Sum up replicate columns in dataframe, keep rows unique

I thought this would be a relatively easy task to do but I couldn't find examples here that weren't focused on summing up rows based on column conditions. What I'm trying to achieve is to sum up ...
Katherine Chau's user avatar
1 vote
2 answers
72 views

R - Reshape list with matrices

I am working with a list of matrices that was created from the output of combn: lapply(2:length(c("A","B","C","D","E")), function(n) combn(c("A&...
thiagoveloso's user avatar
  • 2,671
2 votes
1 answer
49 views

Pivoting dataset to long format for all variable pairs following specific name pattern

I've got data from an experiment with 2 conditions where each participant got tested in both conditions for various properties. The dataset is in wide format, the variable name pattern is like this: ...
Madamadam's user avatar
  • 918
1 vote
1 answer
67 views

Compute row sums and column sums efficiently in Julia

Consider the code below test_vector = 1:100 group_size = 10 num_groups = div(length(test_vector), group_size) res_1 = sum(reshape(test_vector, group_size, num_groups), dims=1) res_2 = sum(reshape(...
user1691278's user avatar
  • 1,845
5 votes
3 answers
218 views

merge groups of columns in a polars dataframe to single columns

I have a polars dataframe with columns a_0, a_1, a_2, b_0, b_1, b_2. I want to convert it to a longer and thinner dataframe (3 x rows, but just 2 columns a and b), so that a contains a_0[0], a_1[0], ...
DeltaIV's user avatar
  • 5,539
1 vote
2 answers
35 views

R : Reshape Long => wide with different value length

I want to reshape from long to wide the following data base df_long <- data.frame( indiv_id = c(rep(1,2), rep(2,6), rep(3,4)), value = c(sample(x = 2), sample(x = 6), sample(x = 4)), field_id ...
Jamman's user avatar
  • 11
-2 votes
1 answer
113 views

How to disable ReSharper but keep dotTrace and dotMemory available in VS2022?

I want to run dotTrace and dotMemory from Visual Studio 2022. I do not want ReSharper in any form or shape. Is there a way to achieve this? Please note - this question is about how to start dotTrace/...
Boppity Bop's user avatar
  • 10.3k
0 votes
0 answers
35 views

Rowwise comparison in R for several fields [duplicate]

Suppose you have a dataframe df_matches with transaction data structured in the following way: | REPORT_ID| VALUE | SIDE | COUNTRY | CP1 | CP2 |... | -------- | -------- | -------- | ...
Marius's user avatar
  • 3
0 votes
1 answer
93 views

reshape dataframe based on event occurance and clearing

i want to see if there is an efficient way to reshape dataframe that is read from a tab separated csv file. the data consist of event codes and messages that are stacked up vertically with their ...
Hannibal's user avatar
  • 105
0 votes
0 answers
24 views

how dcast melted data winto a table with header and sub-header?

I have Input data like the one below and I want to know if there is any way to reshape it into an Excel format with a header and sub-header. Input: Cons rep name value 10 N=1 A 12 ...
star's user avatar
  • 765
0 votes
1 answer
81 views

Long to wide in Python or SQL with all possible data combinations in columns

Input format: CUSTOMER MONTH ISSUE 1 M1 ABC 1 M1 DEF 1 M2 ABC 1 M3 QRS 2 M1 PQR 2 M2 PQR 2 M2 ABC 2 M3 DEF Desired output format: CUSTOMER M1 M2 M3 1 ABC ABC QRS 1 ...
Anjana's user avatar
  • 3
0 votes
0 answers
15 views

Shape issues in Training a Keras Model

Here is the code that I have written: Df_input = df_close[input_col] df_Output = df_close[Output_cols] def preprocess_multistep_lstm(Input_Sequence, Output_Sequence, n_steps_in, n_steps_out, features, ...
Jaffer Wilson's user avatar
3 votes
3 answers
96 views

Is it possible to reorder a table in R?

I have a table as belowe: dput(df) structure(list(Samples = c("Cont-4", "Cont-4", "Cont-4", "Cont-4", "Cont-4", "Cont-4", "Cont-4"...
A.Mokhtari's user avatar

15 30 50 per page