Top "Reshape" questions

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

Python Reshape 3d array into 2d

I want to reshape the numpy array as it is depicted, from 3D to 2D. Unfortunately, the order is not …

python numpy reshape
Convert data from many rows to many columns

I have data that comes out of a DB in a normalized way with a field for year, state, and …

r reshape
R re-arrange dataframe: some rows to columns

I'm not even sure how to title the question properly! Suppose I have a dataframe d: Current dataframe: d <…

r dataframe reshape
How to create a pivot table in R with multiple (3+) variables

I am having problems in create a pivot table with a data frame like this: c1 c2 c3 c4 E 5.76 201 …

r reshape
How can I change the shape of a variable in TensorFlow?

TensorFlow tutorial says that at creation time we need to specify the shape of tensors. That shape automatically becomes the …

matrix reshape tensorflow
Reshape wide to long in pandas

Let's assume that I have the following dataframe in pandas: AA BB CC date 05/03 1 2 3 06/03 4 5 6 07/03 7 8 9 08/03 5 7 1 and I want to transform it …

python pandas dataframe reshape
Pivoting rows into columns

Suppose (to simplify) I have a table containing some control vs. treatment data: Which, Color, Response, Count Control, Red, 2, 10 Control, …

r reshape
How to "unmelt" data with reshape r

I have a data frame that I melted using the reshape package that I would like to "un melt". here …

r reshape reshape2
reshape vs. reshape2 in R

I am attempting to understand why development had shifted from reshape to reshape2 package. They seem to be functionally the …

r reshape reshape2
Is this the best way to add an extra dimension to a numpy array in one line of code?

If k is an numpy array of an arbitrary shape, so k.shape = (s1, s2, s3, ..., sn), and I want …

python arrays python-3.x numpy reshape