dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.05k stars 1.88k forks source link

How to Group By with multiple columns? #7243

Open chuongmep opened 1 month ago

chuongmep commented 1 month ago

Is your feature request related to a problem? Please describe. I want can use GroupBywith list input column for dataframe

Describe the solution you'd like A clear and concise description of what you want to happen.

It could be good like this and allow return with new dataframe

var groupBy = df.GroupBy(new string[] { "Area", "Level" });

Or :

df.GroupBy("Level", "Building Name").Select("Source File", "Area", "Level", "Building Name");

This is python :

df_report_grouped = df_report.groupby(['Building Name', 'Level'])['Area'].sum().reset_index()

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

asmirnov82 commented 1 month ago

Hi, @chuongmep this is duplicated to https://github.com/dotnet/machinelearning/issues/5724 and was initialy planned for ML.Net 3.0 (however looks like development was postponed). See more details here: https://github.com/dotnet/machinelearning/issues/6144