Top "Melt" questions

In R, the "melt" function from the "reshape2" and "data.

How to name each variable using melt

I have a matrix that I want to reform for plotting in ggplo2 using the melt function from reshape2 but …

r reshape2 melt
Melt the Upper Triangular Matrix of a Pandas Dataframe

Given a square pandas DataFrame of the following form: a b c a 1 .5 .3 b .5 1 .4 c .3 .4 1 How can the upper triangle …

python pandas numpy reshape melt
Pandas Melt with Multiple Value Vars

I have a data set which is in wide format like this Index Country Variable 2000 2001 2002 2003 2004 2005 0 Argentina var1 12 15 18 17 23 29 1 Argentina var2 1 3 2 5 7 5 2 Brazil …

python pandas melt
Python Pandas Sum Values in Columns If date between 2 dates

I have a dataframe df which can be created with this: data={'id':[1,1,1,1,2,2,2,2], 'date1':[datetime.date(2016,1,1),datetime.date(2016,1,2),datetime.…

python pandas dataframe pandas-groupby melt
Using melt with matrix or data.frame gives different output

Consider the following code: set.seed(1) M = matrix(rnorm(9), ncol = 3) dimnames(M) = list(LETTERS[1:3], LETTERS[1:3]) print(M) A B C …

r matrix dataframe reshape2 melt
R: Pivot the rows into columns and use N/A's for missing values

I have a dataframe that looks something like this NUM <- c("45", "45", "45", "45", "48", "50", "66", "66", "66", "68") Type <- c("A", "F", "C", "…

r dataframe pivot reshape melt
Pandas Melt several groups of columns into multiple target columns by name

I would like to melt several groups of columns of a dataframe into multiple target columns. Similar to questions Python …

python pandas melt