Questions tagged [reshape]
In R, Matlab, NumPy and APL, reshape functions allow data to be transformed into more convenient forms.
reshape
3,904
questions
0
votes
0
answers
12
views
Why reshape is needed for Sequential models after minmaxscaler class? and how to use?
My recent project is based on 'Stock Prediciton" I'm working on df["Open"] as nd.array.
Trying to understand intuitively how this works and whether my predicted data will be correct or ...
0
votes
2
answers
33
views
merge multiple DFs based on column names and row names in R [duplicate]
I have 3 Dfs
I need to split it based on columns and row names like shown below
I tried merge_recurse option from reshape, looks like it merges row by row. Please help me to get the columns added side ...
1
vote
3
answers
55
views
Equivalence between reshape, strides and transpose? (numpy)
i am sorry for the very naive question.
I have these lines of numpy code, with a transpose at the beginning, and strides and reshape are used afterward.
I wonder if by re-ordering indices in reshape ...
1
vote
1
answer
27
views
R issue with reshape, reshape is not ordering columns correctly
I am trying to use reshape function in R to arrange my data timepoints in a table. The variable that I am using to split it is numerical, but when reshape arranges the table it incorrectly puts 2,0.5,...
2
votes
1
answer
24
views
How to subset a melt object
My issue
I have melt object from reshape2 library.
I would like to subset variables with value==1.
However, when I select value from subset melt object, I get the id instead of variable.
How to get a ...
1
vote
1
answer
55
views
Reshape Pandas Dataframe and group by 2 level columns
I have a dataframe with flat structure of having unique Rows as follow.
I need to reshape it as shown below.
Using Pivot table and swapping levels, I managed to obtain somewhat closer to the result, ...
0
votes
1
answer
20
views
Troubleshooting onnxruntime inference - X num_dims does not match W num_dims
Using the nnhash.py script found here: https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX
# Copyright 2021 Asuhariet Ygvar
#
# Licensed under the Apache License, Version 2.0 (the "License&...
0
votes
1
answer
42
views
this code show an reshape error. how fix this?
I'm new in python and ML. I wrote this code for practicing. It displays this error. how do I solve this reshape problem?
import pandas as pd
import sklearn as skl
data=pd.read_csv('housing.csv')
...
2
votes
3
answers
72
views
Converting dataframe from "wide" to "long" format with pairs of ID variables
Here's an example of what I am trying to do. I am starting with a dataframe in "wide" format, like below.
#sample dataframe
id_1 <- c(260, 500, 640, 720)
id_2 <- c(261, 501, 641, 721)
...
0
votes
1
answer
89
views
How to reshape (n,) array to (n,3) array? [closed]
I have an array with (n,) dimension and for a project I need to have this array with (n,3) shape.
This array is a set of a 3-dimensional points.
This is the code :
vertices = np.array([line[7:] for ...
0
votes
0
answers
40
views
Performance of numpy matrix vector product on scipy.stats.qmc.Sobol vector when changing reshaping order
Solution at the bottom.
I am trying to implement a Brownian bridge and want to speed up the path construction via numpy matrix multiplication, once the bridge is initialised. I am drawing data for 3 ...
0
votes
1
answer
36
views
Reshape seems to be losing observations
i am using reshape in dplyr to turn a long data table into a wide one. but when i do, i seem to be losing some observations. the data table called "data" is a record of 6 different species ...
0
votes
1
answer
57
views
How to divide a 2-D tensors into smaller blocks using pytorch?
I've downloaded the EMNIST dataset of letters, and I've converted each image to a torch.tensor object with shape torch.size([28, 28]). However, I would like divide the 28*28 image into 7*7 blocks, ...
0
votes
0
answers
48
views
Pandas move levels of a composite column as a value
Let's imagine as a starting point I have a dataframe, similar to the one below (using a tuple for the composite columns):
Index, (ATop,AMiddle,ABottom,filt1_1, filt2_1), (ATop,AMiddle,ABottom,filt1_2,...
0
votes
0
answers
89
views
reshape a tensor in firebase cloud functions
Im working on a machine learning project and since I don't know the amount of categories in the dependend variables I don't want to hardcode it. In my project now I have 3 different categories but I ...