This article was published as a part of the Data Science Blogathon.
Food brings people together, on many different levels!
From ‘Chole Bhature’ and ‘Paneer Masala’ of North to ‘Idli’, ‘Dosa’, and ‘Rassam’ of South, from ‘Dal Bati’ and ‘Dal Dhokli’ of Gujarat, Rajasthan to Bengali sweets and Spicy non-vegetarian food of Assam, Maharashtra’s Zunka, bhaji to Bihar’s Litti Chokha! Indian cuisine is all about mouth-watering dishes. It’s not just the food but the emotion!
Here’s an Indian cuisine analysis using various Data Analysis techniques. So, are you ready to experience the sweetness of the east, a bit spicy meal from the north, mouth-watering dishes from the east, and some delicious cuisine of the South?
Here’s the link to the dataset used: Dataset
This dataset is about the Indian Cuisine Variety. It tells us about various dishes in various states and regions. Besides, it tells us the course of these food dishes and their flavor profiles. So let’s do some analysis of this data! First, importing required libraries :
import geopandas as gpd import plotly.express as px from plotly.offline import init_notebook_mode import matplotlib.pyplot as plt %matplotlib inline from wordcloud import WordCloud , ImageColorGenerator from PIL import Imagess 'pandas.core.frame.DataFrame'>
First, let’s see how many sweet and spicy dishes are included in our dataset.
pie_df = cuisine.flavor_profile.value_counts().reset_index() pie_df.columns = ['flavor_profile', 'count'] fig = px.pie(pie_df, values='count', names='flavor_profile', title='Sweet or Spicy?', color_discrete_sequence=['blue', 'light green']) fig.show()
Here, some graphs are plotted which will tell us how much preparation and cooking time is required for different dishes. To get to know more about these graphs I’m providing the link of the whole code at the end! Here’s is one sample code for Bar graph :
reg_df = cuisine.flavor_profile.value_counts().reset_index() reg_df.columns = ['flavor_profile', 'prep_time'] reg_df = reg_df.sample(frac=1) fig = px.bar(reg_df,x='flavor_profile',y='prep_time',title='Okay!variety in spicy food items is more, but it takes more time to get prepared! Are you ready to wait?', color_discrete_sequence=['purple']) fig.show()
Okay! The variety of spicy food items is more, but it also takes more time to prepare them! Are you ready to wait?
It took more time to prepare, but wait! sweet dishes also take much time to get cooked, not more than spicy dishes though! 😉
Let’s order the main course, as it takes more time to get prepared! Well, don’t forget to order your favorite dessert!
Snacks are here! Umm, the main course may take some more time, and dessert too!
Now, let’s see if we can guess the names of states from the names of dishes! Here, I’ve created word clouds for various states. First, have a look at the code.
mh_cuisine = cuisine[cuisine['state']=='Maharashtra'].reset_index() name = [] for i in range(0,len(mh_cuisine)): text = mh_cuisine['name'][i].split(',') text = ','.join(text) name.append(text) text = ' '.join(name) wordcloud = WordCloud(width = 500, height = 500, background_color ='black', min_font_size = 14).generate(text) plt.figure(figsize = (4, 4), facecolor = None) plt.imshow(wordcloud) plt.axis('off') plt.show()
g_cuisine = cuisine[cuisine['state']=='Gujarat'].reset_index() name = [] for i in range(0,len(g_cuisine)): text = g_cuisine['name'][i].split(',') text = ','.join(text) name.append(text) text = ' '.join(name) wordcloud = WordCloud(width = 500, height = 500, background_color ='black', min_font_size = 14).generate(text) plt.figure(figsize = (4, 4), facecolor = None) plt.imshow(wordcloud) plt.axis('off') plt.show()
r_cuisine = cuisine[cuisine['state']=='Rajasthan'].reset_index() name = [] for i in range(0,len(r_cuisine)): text = r_cuisine['name'][i].split(',') text = ','.join(text) name.append(text) text = ' '.join(name) wordcloud = WordCloud(width = 500, height = 500, background_color ='black', min_font_size = 14).generate(text) plt.figure(figsize = (4, 4), facecolor = None) plt.imshow(wordcloud) plt.axis('off') plt.show()
Maharashtra’s Amti, Gujarat’s Dal Dhokli, and Rajasthan’s Dal Bati!
Here are the ingredients used in West Indian Food :
Assam’s spicy food, Bengal’s sweetness, and Odisha’s variety!
Here are the ingredients used in East Indian Food :
Let’s see dishes from some other states :
Aloo tikki, paneer masala, chole bhature….list goes on!
Here are the ingredients used in North Indian Food :
South Indian sambar with idli, dosa!
We’ve seen all the ingredients used in each part of India. Have you observed that few ingredients are common in 2 or 3 regions? Let’s do some Cuisine analysis with respect to ingredients!
So, here are the ingredients which are used in most of the dishes.
ingredients = pd.Series(cuisine.ingredients.str.split(',').sum()).value_counts() ingredients = ingredients[ingredients>12] px.bar(ingredients, y=ingredients.values, x=ingredients.index, color=ingredients.values, title= 'Indian cuisine is nothing without these top ingredients!', labels={ 'index': 'Inngredients', 'y': 'count' })
Indian cuisine is nothing without these top ingredients :
Though the following ingredients are used less, they help in making the food more tasty and yummy!
So, this was the Indian Cuisine analysis. Conclusions drawn are as follows :
Flavour_profile: In India, while ordering food, one can get many options in Spicy dishes as compared to sweet dishes.
Time: Mostly, Spicy dishes take more time in preparation as well as cooking. Some of the sweet dishes also need more cooking time.
Ingredients: Indian Cuisine has much variety from North to South, and also from East to West! However, few ingredients are common in many dishes.
Here’s the link to code from Kaggle:
Here’s the Github repository link :
– Arya Talathi
The results are only as accurate as the raw datasets. There's almost no data on tribal food from the NE states besides a few dishes from Assam. Let alone more granular regional variations from lower-caste kitchens. The skew toward vegetarian dishes also represents biases inherent in the researchers teams.
Profoundly excellent information
Looks like the blog page is corrupted...images not loading... Programming commands all visible in place of text...Please correct it... really enjoying the content...