nums = new int[]{1,1,2,3,4,4,4,4,5};
var groupS =nums.GroupBy(x => x);
// for detail view take look at below or click on source link
// https://leetcode.com/problems/majority-element/discuss/2657752/103-ms-faster-than-97.70-of-C-online-submissions-One-Liner
GROUP BY: is used to collaborate
with the SELECT statement to arrange
matching data into groups.
ORDER BY: is for sorting result
either in descending or ascending order.
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
dd=pd.melt(df,id_vars=['Group'],value_vars=['Apple','Orange'],var_name='fruits')
sns.boxplot(x='Group',y='value',data=dd,hue='fruits')