when DataFrame has mutliIndex,how to visualize it?
So your question is how to plot the top 3 game genres for each game platform (console). You are definitely on the right track in using the groupby method.
It is a bit long winded, but this would definitely do the job:
c = df.groupby([&quot;Platform&quot;, &quot;Genre&quot;]).size().reset_index()
c.columns = [&quot;Platform&quot;, &quot;Genre&quot;, &quot;Frequency&quot;]

for p in df[&quot;Platform&quot;].unique():
    &quot;&quot;&quot;
    This line will take a subset of the c dataframe such that it only contains
    entries for a particular platform.
    The .sort_values() method will then arrange the frequency in descending order.
    The .head(n) will then take the top n entries and therefore, the top three genres
    for a particular platform.
    &quot;&quot;&quot;
    df_ = c[c[&quot;Platform&quot;] == p].sort_values(&quot;Frequency&quot;)
    sns.barplot(x = &quot;Platform&quot;, y = &quot;Frequency&quot;, hue = &quot;Genre&quot;, data = df_)
    plt.show()

Here, you can edit the code so that for each platform, each graph appears on a separate axis.