cudf.DataFrame.melt#

DataFrame.melt(
id_vars=None,
value_vars=None,
var_name=None,
value_name='value',
col_level=None,
ignore_index: bool = True,
)[source]#

Unpivots a DataFrame from wide format to long format, optionally leaving identifier variables set.

Parameters:
frameDataFrame
id_varstuple, list, or ndarray, optional

Column(s) to use as identifier variables. default: None

value_varstuple, list, or ndarray, optional

Column(s) to unpivot. default: all columns that are not set as id_vars.

var_namescalar

Name to use for the variable column. default: frame.columns.name or ‘variable’

value_namestr

Name to use for the value column. default: ‘value’

Returns:
outDataFrame

Melted result