fslaborg / Deedle

Easy to use .NET library for data and time series manipulation and for scientific programming
http://fslab.org/Deedle/
BSD 2-Clause "Simplified" License
924 stars 196 forks source link

Change melt to have optional parameters in line with Pandas DateFrame and R's data.table #554

Open totalgit74 opened 1 year ago

totalgit74 commented 1 year ago

Currently the FrameModule.Melt method converts all columns to key-value pairs under the index. It would good to be able to provide parameters like Python's Pandas DataFrame and R's data.table melt operations where you can specify the ID columns to use to distinguish the rows (effectively the index) and the columns you actually wish to melt. It is possible to mimic this behaviour by re-indexing and sub-setting columns before melting but it is likely nowhere near as efficient as being able to implement the functionality under the hood where it can be better optimised, especially as the frames get much larger.

Pandas melt

melt.data.table, Vignette