Top "Reshape" questions

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

What does -1 mean in numpy reshape?

A numpy matrix can be reshaped into a vector using reshape function with parameter -1. But I don't know what …

python numpy reshape numpy-ndarray
How to reshape data from long to wide format

I'm having trouble rearranging the following data frame: set.seed(45) dat1 <- data.frame( name = rep(c("firstName", "secondName"), …

r reshape r-faq
load csv into 2D matrix with numpy for plotting

Given this CSV file: "A","B","C","D","E","F","timestamp" 611.88243,9089.5601,5133.0,864.07514,1715.37476,765.22777,1.291111964948E12 611.88243,9089.5601,5133.0,864.07514,1715.37476,765.22777,1.291113113366E12 611.88243,9089.5601,5133.0,864.07514,1715.37476,765.22777,1.291120650486E12 I simply want to load it …

python arrays csv numpy reshape
Grouped bar plot in ggplot

I have a survey file in which row are observation and column question. Here are some fake data they look …

r ggplot2 bar-chart reshape reshape2
Reshape an array in NumPy

Consider an array of the following form (just an example): [[ 0 1] [ 2 3] [ 4 5] [ 6 7] [ 8 9] [10 11] [12 13] [14 15] [16 17]] It's shape is [9,2]. Now I want to transform the array …

python arrays numpy reshape
Reshaping data.frame from wide to long format

I have some trouble to convert my data.frame from a wide table to a long table. At the moment …

r dataframe reshape r-faq
Compute mean and standard deviation by group for multiple variables in a data.frame

Edit -- This question was originally titled << Long to wide data reshaping in R >> I'm just …

r aggregate reshape reshape2
ValueError: cannot reshape array of size 30470400 into shape (50,1104,104)

I am trying to run threw this Tutorial http://emmanuelle.github.io/segmentation-of-3-d-tomography-images-with-python-and-scikit-image.html where I want to do …

python numpy reshape
Gather multiple sets of columns

I have data from an online survey where respondents go through a loop of questions 1-3 times. The survey software (…

r reshape dplyr qualtrics tidyr
Python reshape list to ndim array

Hi I have a list flat which is length 2800, it contains 100 results for each of 28 variables: Below is an example …

python numpy reshape