text_html_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

india_nutrition_facts = pd.read_csv('../input/mcdonalds-india-menu-nutrition-facts/India_Menu.csv')

def highlight_color(s):
    return ['background-color: #FFC72C'] * 8 if s.name == 'Trans fat (g)' else [''] * 8
india_nutrition_facts.describe().style.apply(highlight_color, axis=0)

fig, axs = plt.subplots(figsize=(15,8))
plt.rcParams.update({'font.size': 9.5})
ax = [None for _ in range(10)]

df_num_features = india_nutrition_facts.select_dtypes(include=[np.number])
num_features = df_num_features.columns.tolist()
num_features.remove("Trans fat (g)")

for i in range(len(num_features)):
    ax[i] = plt.subplot2grid((3,5), (i//3,i%3), colspan=1)
    ax[i] = sns.violinplot(data=india_nutrition_facts[num_features[i]], orient="h", color='#FFC72C')
    plt.title(num_features[i])

ax[9] = fig.add_axes([0.62,0.232,0.38,0.5])
ax[9] = sns.violinplot(data=india_nutrition_facts["Trans fat (g)"], orient="h", color='#DA291C')
plt.title("Trans fat (g)", fontweight="bold")

plt.suptitle("Distribution of the Content of Each Nutrition", fontsize=15)
plt.tight_layout()
plt.show()

del df_num_features

def highlight_color(s):
    return ['background-color: #FFC72C'] * 13 if s.name == 25 else [''] * 13
india_nutrition_facts[india_nutrition_facts['Menu Items'].str.endswith('Chicken Strips')].style.apply(highlight_color, axis=1)

for c in ['Trans fat (g)', 'Total carbohydrate (g)', 'Cholesterols (mg)', 'Sat Fat (g)']:
    india_nutrition_facts.loc[25, c] = india_nutrition_facts.loc[24, c] * 5 / 3
def highlight_color(s):
    return ['background-color: #FFC72C'] * 13 if s.name == 25 else [''] * 13
india_nutrition_facts[india_nutrition_facts['Menu Items'].str.endswith('Chicken Strips')].style.apply(highlight_color, axis=1)

india_nutrition_facts[india_nutrition_facts['Menu Items'].str.startswith('Piri piri Mc Spicy')]