Skip to main content

All Questions

Tagged with
0 votes
0 answers
15 views

Unexpected coordinate switching when reshaping object positions into 3D grid after flattening and integrating

I am working on processing and analyzing velocity field data from VTI files using Python. The workflow includes reading VTI files, extracting velocity data, computing object trajectories, generating ...
Toto's user avatar
  • 11
-3 votes
0 answers
39 views

cannot reshape array of size 1000 into shape (100,100) [closed]

>>> cent_rand = np.random.randint(1919, 3946, 1000) >>> len(cent_rand) 1000 >>> two_d_cent = cent_rand.reshape((100,100)) Traceback (most recent call last): File "<...
rosa elena's user avatar
1 vote
1 answer
56 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, ...
rush dee's user avatar
  • 336
0 votes
1 answer
21 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&...
Joshua Terrill's user avatar
0 votes
1 answer
90 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 ...
Margot Berranger's user avatar
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 ...
Severin's user avatar
0 votes
3 answers
46 views

How can I add a dimension to Torch tensor with values of first two dimensions repeated in the new dimension

I have a Tensor of shape [a,b]. How can I reshape it to [a,b,c] such that all the values along the new dimensions repeat values of the i,j entry of the original tensor of shape [a,b]? ex: a = 2, b= 3 ...
Lrom's user avatar
  • 13
0 votes
0 answers
18 views

how to build a vae without reshape error?

I build a VAE following https://blog.tensorflow.org/2019/03/variational-autoencoders-with.html PROBLEM: I thick the problem is in the decoder when I want to reshape the latent Distribution i face this ...
mmd-ghamgosar's user avatar
1 vote
1 answer
32 views

Given a few block matrices, get the overall large matrix

In short, we are given a 4D tensor y of shape ( B // s2, D2 // s1, s1, s2), where y[i,j,...] represents a matrix of shape (s1,s2). These are the block matrices used to construct the overall large ...
Goldenalcheese's user avatar
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
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
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
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
0 votes
1 answer
165 views

numpy reshape implementation

My main focus will on this page. First, I don't understand the page. For the first parameter shape, ndarray.reshape(shape, order='C') why this method on ndarray allows the elements of the shape ...
JJ.'s user avatar
  • 113

15 30 50 per page
1
2 3 4 5
68