100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
HomeBlogLearn Data Science Through Bollywood Box Office Analytics
Learn Through Hobbies

Learn Data Science Through Bollywood Box Office Analytics

SV

SkillVeris Team

Content Team

May 13, 2026 10 min read
Share:
Learn Data Science Through Bollywood Box Office Analytics
Key Takeaway

Learning data science through entertainment data is far more engaging than generic datasets.

In this guide, you'll learn:

  • Bollywood box office data teaches groupby aggregation, correlation analysis, time-series trends, and matplotlib visualisation.
  • The explode() function cleanly handles columns that pack multiple comma-separated values into one cell.
  • Use median rather than mean for box office analysis, because blockbusters distort means dramatically.
  • A weak correlation between IMDb rating and revenue is a genuine insight, not a data artefact.

1Why Bollywood Data?

Hindi cinema is one of the world's most prolific film industries, producing 100 to 200 mainstream releases a year with rich accompanying data: box office collections, IMDb ratings, release dates, genres, directors, and stars. This data teaches the same skills as any business dataset, including groupby, correlation, time-series, and sorting.

The difference is motivation: you actually care whether Pathaan or KGF 2 has better ROI. When the data connects to something you love, the drive to clean it, explore it, and go deeper is intrinsic rather than forced.

2Getting the Dataset

Several Bollywood datasets are available for free, and any of them with a few hundred films and a collection column will work for every analysis in this guide. For this walkthrough, assume a CSV named bollywood_box_office.csv with columns for title, year, director, genre, budget_cr, collection_cr, imdb_rating, and release_month (where cr means crore INR).

  • Kaggle: search 'Bollywood movies dataset' or 'Hindi box office'; several CSVs include 1000+ films with box office, IMDb rating, director, cast, and genre.
  • IMDb datasets: imdb.com/interfaces/ provides downloadable TSV files with global film data including Indian cinema.
  • Box Office Mojo: scrape-able but check the terms; Kaggle re-distributions are cleaner for learning.

3Loading and Exploring

Start by loading the CSV with pandas and taking a first look at its shape, head, data types, and null counts. Every real dataset needs cleaning before analysis.

Here, coerce the collection column to numeric and drop rows with no collection data, then describe() the column to get a quick statistical summary.

Four core data science techniques practised through Bollywood analytics: load, groupby, correlate, chart.
Four core data science techniques practised through Bollywood analytics: load, groupby, correlate, chart.

Load and clean

Read the CSV, inspect it, and coerce the collections column.

code
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("bollywood_box_office.csv")
# First look
print(df.shape)        # (n_films, n_columns)
print(df.head(3))
print(df.dtypes)
print(df.isnull().sum())   # nulls per column
# Clean: fill missing collections with NaN, drop rows with no collection data
df["collection_cr"] = pd.to_numeric(df["collection_cr"], errors="coerce")
df = df.dropna(subset=["collection_cr"])
# Summary stats
print(df["collection_cr"].describe())

4Top 10 Grossing Films of All Time

Sorting by collection and taking the top 10 is the simplest meaningful query, and a horizontal bar chart presents it well. A horizontal layout is ideal here because film titles are long and read naturally across the page.

This is also a clean first matplotlib exercise: set a figure size, draw the bars, label the axes, and save the figure.

Top 10 bar chart

nlargest selects the films and barh draws them horizontally.

code
# Sort by collection, take top 10
top10 = (df.nlargest(10, "collection_cr")
         [["title", "year", "collection_cr"]])
print(top10.to_string(index=False))
# Bar chart
fig, ax = plt.subplots(figsize=(10, 6))
ax.barh(top10["title"][::-1], top10["collection_cr"][::-1], color="#f59e0b")
ax.set_xlabel("Box Office Collections (Crore INR)")
ax.set_title("Top 10 Highest-Grossing Bollywood Films", fontsize=14, fontweight="bold")
ax.grid(axis="x", alpha=0.3)
plt.tight_layout()
plt.savefig("top10_grossers.png", dpi=150)
plt.show()

5Box Office by Decade

Creating a decade column with integer division lets you aggregate collections over time and reveal long-run trends. Group by decade and sum the collections to see which eras earned most in total.

Using median instead of mean for per-film analysis is a deliberate choice: a single blockbuster like KGF 2 or Pathaan can make the mean unrepresentative of a typical film in that decade.

Aggregating by decade

Derive a decade column, then sum and take the median per decade.

code
# Create decade column
df["decade"] = (df["year"] // 10) * 10
# Total collections per decade
decade_totals = (df.groupby("decade")["collection_cr"]
                 .sum()
                 .reset_index())
# Median (not mean - protects against blockbuster outliers)
decade_medians = df.groupby("decade")["collection_cr"].median()
plt.figure(figsize=(10, 5))
plt.bar(decade_totals["decade"].astype(str), decade_totals["collection_cr"],
        color="#3b82f6", width=8)
plt.title("Total Box Office Collections by Decade", fontsize=14, fontweight="bold")
plt.xlabel("Decade")
plt.ylabel("Total Collections (Crore INR)")
plt.tight_layout()
plt.show()

6Genre Analysis: Which Genres Earn Most?

Many films list multiple genres in a single cell, such as 'Action, Drama'. The explode() function takes a column containing lists and creates one row per list item, expanding the DataFrame so each genre can be analysed separately.

After exploding, group by genre and compute the median collection, keeping only genres with at least ten films so the comparison is meaningful. explode() is the right tool any time a single cell holds multiple comma-separated values.

Top grossers, genre trends, IMDb versus revenue, and the holiday effect: four film analytics questions.
Top grossers, genre trends, IMDb versus revenue, and the holiday effect: four film analytics questions.

Exploding genres

Split, explode, and aggregate per genre.

code
# Some films have multiple genres e.g. "Action, Drama"
# Explode on comma to analyse each genre separately
df_genres = df.copy()
df_genres["genre"] = df_genres["genre"].str.split(",")
df_genres = df_genres.explode("genre")
df_genres["genre"] = df_genres["genre"].str.strip()
# Median collections per genre (min 10 films)
genre_stats = (df_genres.groupby("genre")
               .agg(median_cr=("collection_cr", "median"),
                    film_count=("title", "count"))
               .query("film_count >= 10")
               .sort_values("median_cr", ascending=False))
print(genre_stats.head(10))

7Does IMDb Rating Predict Collections?

A scatter plot of IMDb rating against box office collection, combined with a Pearson correlation coefficient, tests whether quality predicts revenue. The typical result is a weak positive correlation, around r of 0.2 to 0.4.

The scatter almost always shows that many low-rated films are commercial hits while critically acclaimed films often underperform. This is a genuine insight about the film industry and a clean lesson about the difference between correlation and causation.

Scatter and correlation

Plot rating against revenue and compute the correlation.

code
# Scatter plot: IMDb rating vs box office
clean = df.dropna(subset=["imdb_rating", "collection_cr"])
fig, ax = plt.subplots(figsize=(9, 6))
ax.scatter(clean["imdb_rating"], clean["collection_cr"],
           alpha=0.4, color="#8b5cf6", s=30)
ax.set_xlabel("IMDb Rating")
ax.set_ylabel("Box Office Collection (Cr INR)")
ax.set_title("IMDb Rating vs Box Office: Does Quality Predict Revenue?",
             fontsize=13, fontweight="bold")
plt.tight_layout()
plt.show()
# Pearson correlation coefficient
r = clean["imdb_rating"].corr(clean["collection_cr"])
print(f"Pearson r = {r:.3f}")
# Typical result: r ~ 0.2-0.4 (weak positive - quality helps but doesn't determine revenue)

8Holiday Release Effect

Mapping release months to festival seasons such as Eid, Diwali, and Christmas tests whether timing boosts collections. Use the month as a proxy, map it to a season label, and compute the median collection per season.

The result typically shows Eid and summer releases with significantly higher median collections. That is partly selection bias, since studios release their biggest films at peak times, but the pattern is real and matches industry intuition.

Season medians

Map months to seasons and compare median collections.

code
# Does releasing on Eid, Diwali, or Christmas boost collections?
# Month proxies: Eid varies (April-June), Diwali Oct-Nov, Christmas Dec
holiday_months = {4: "Eid/Summer", 5: "Eid/Summer", 6: "Eid/Summer",
                  10: "Diwali", 11: "Diwali", 12: "Christmas"}
df["season"] = df["release_month"].map(holiday_months).fillna("Regular")
season_median = (df.groupby("season")["collection_cr"]
                 .median()
                 .sort_values(ascending=False))
print(season_median)

9Director and Actor Impact

Grouping by director and computing the median collection, with a minimum film count, surfaces the most consistently bankable filmmakers. You can also track a single director's trajectory over time to see whether they are improving or declining.

Plotting one director's films by year, sorted chronologically, turns the data into a simple career arc you can read at a glance.

Director performance and trend

Rank directors by median, then chart one director over time.

code
# Directors with highest median collections (min 5 films)
director_perf = (df.groupby("director")
                 .agg(median_cr=("collection_cr", "median"),
                      films=("title", "count"))
                 .query("films >= 5")
                 .sort_values("median_cr", ascending=False)
                 .head(10))
print(director_perf)
# Trend: is a director improving or declining?
sanjay_films = df[df["director"] == "Rajkumar Hirani"].sort_values("year")
plt.plot(sanjay_films["year"], sanjay_films["collection_cr"], marker="o")
plt.title("Rajkumar Hirani: Box Office Over Time")
plt.show()

10Building a Dashboard

Once your individual charts work, combine them into a single multi-panel figure using a 2x2 grid of subplots. A shared title and tight layout turn four separate plots into one cohesive dashboard.

For an interactive version, deploy the same analysis as a Streamlit app instead of a static image.

Multi-panel figure

Arrange four charts into one dashboard figure.

code
fig, axes = plt.subplots(2, 2, figsize=(16, 10))
fig.suptitle("Bollywood Box Office Analytics Dashboard",
             fontsize=18, fontweight="bold")
# Top 10 bar chart in axes[0,0]
# Decade totals in axes[0,1]
# Genre medians in axes[1,0]
# IMDb scatter in axes[1,1]
plt.tight_layout()
plt.savefig("bollywood_dashboard.png", dpi=150, bbox_inches="tight")
plt.show()

11Extending the Analysis

Once the core analysis is in place, there are many directions to take it further, from ROI calculations to star-power breakdowns and predictive modelling. Each extension reinforces a different data science skill.

  • Budget vs collection: calculate ROI for each film and find which genres give the best return.
  • Star power: split the cast column, explode by actor, and calculate median collections per lead actor.
  • Sentiment analysis: fetch review data and correlate sentiment scores with box office.
  • Predictive model: use scikit-learn to predict collections from budget, genre, director, and release month.

12Key Takeaways

Bollywood data teaches the same pandas skills as any business dataset, with built-in motivation to keep exploring.

  • Bollywood data teaches the same pandas skills as any business dataset, with built-in motivation to explore.
  • explode() handles comma-separated multi-value columns cleanly.
  • Use median rather than mean for box office analysis, because blockbusters distort means dramatically.
  • A weak correlation (r~0.3) between rating and revenue is a genuine insight: quality and commercial success are related but far from the same thing.

13Start Analysing

Continue your data science journey by deepening the techniques used here and turning the analysis into something interactive.

  • Pandas for Beginners: a deep dive on every technique used in this guide.
  • Data Visualisation Best Practices: improve your charts.
  • Build a Streamlit Dashboard: turn this analysis into an interactive app.

14Frequently Asked Questions

Where can I find a good Bollywood dataset? Kaggle has several; search 'Bollywood movies' or 'Hindi box office'. The IMDb datasets at imdb.com/interfaces/ include Indian films and are comprehensive but require filtering. For a simpler start, any Kaggle dataset with 500+ films and box office collection columns will work for all the analyses here.

What currency is typically used in Bollywood box office data? Indian Rupees, usually in crores, where one crore equals 10 million rupees. Some datasets mix currencies or use worldwide collections that include foreign revenue, so check the column description and normalise to a single currency before cross-film comparisons.

Can I do this analysis for Hollywood or Tamil/Telugu films? Absolutely. The same pandas code works on any film dataset with box office and rating columns. The Hollywood dataset from IMDb and Box Office Mojo is even richer, and Tamil and Telugu cinema have their own robust datasets on Kaggle. The analysis patterns transfer entirely; only the data changes.

Is this a good portfolio project? Yes, especially if you add genuine insights rather than just a top-10 list. Frame the analysis around a question such as 'Does releasing on Eid guarantee a hit?' and show the data-supported answer. A project with a clear question, honest analysis, and a surprising insight is far more memorable than a generic exploratory notebook.

📄

Get The Print Version

Download a PDF of this article for offline reading.

About the Publisher

SV

SkillVeris Team

Content Team

We believe the best way to learn tech is through what you already love — sports, music, photography, and more.

View all posts

Never miss an update

Get the latest tutorials and guides delivered to your inbox.

No spam. Unsubscribe anytime.

Frequently Asked Questions

21 categories · pick one to explore

Does SkillVeris have a tech blog, and what does it cover?
Yes, the SkillVeris blog has over 500 articles covering AI and machine learning, programming, web development, DevOps, cloud, security, databases and career guidance. Articles are practical and answer-first, and many use the Learn Through Hobbies approach, teaching technical concepts through cricket, music, gaming or cooking analogies. Everything is free to read.
What is the SkillVeris tech glossary and how big is it?
The SkillVeris glossary is a free reference of roughly 2,000-plus technology terms, each with a clear plain-language definition. It spans AI, programming, web, DevOps, cloud, security and database vocabulary, so whenever a lesson, article or job description uses jargon you do not recognise, the glossary gives you a fast, reliable answer.
Are the developer cheat sheets on SkillVeris free to download?
The cheat sheets are completely free to use, like everything else on SkillVeris. Each sheet condenses a language or tool into its essential syntax, commands and patterns for quick reference while coding. They are designed for rapid lookup during real work, complementing the deeper explanations found in study notes and courses.
Which programming references and cheat sheets are available?
Cheat sheets cover the platform's main domains, including programming languages, AI and ML tooling, web development, DevOps, cloud, security and databases, matching the topics of the 37 live courses. Each sheet lists related reading links and hashtags, so you can jump from a quick reference into fuller study notes or blog articles.
How do I find the meaning of a technical term quickly?
Search the SkillVeris glossary, which holds around 2,000-plus terms with concise, plain-language definitions. Each entry gets to the point in its first sentence, then links to related reading like blog posts or study notes for deeper context. It is faster and more consistent than sifting through scattered search results.
Is the SkillVeris blog good for beginners learning to code?
Yes, many blog articles are written specifically for beginners, and the Learn Through Hobbies style makes them unusually approachable: you might learn Python concepts through cricket or understand APIs through cooking. With 500-plus articles across skill levels, beginners can start with fundamentals and keep reading as they advance, entirely free.
Can cheat sheets replace full courses for learning a language?
No, cheat sheets are references, not teaching tools; they assume you already understand the concepts and just need syntax or commands fast. To actually learn a language, take a structured SkillVeris course with its 24–40 lessons and assessments, then keep the cheat sheet beside you while practising in Code Lab.
How often are new blog articles published on SkillVeris?
The blog grows regularly and already exceeds 500 articles, with new posts added as courses launch and technologies evolve. Topics track the platform's catalogue across AI, programming, web development, DevOps, cloud and security, so checking the Blog section periodically surfaces fresh tutorials, explainers and career-focused pieces, all free to read.
Does the glossary cover AI and machine learning terms?
Yes, AI and machine learning vocabulary is a major part of the roughly 2,000-plus term glossary, covering everything from foundational terms to modern concepts around LLMs, RAG and MLOps. Definitions are plain-language and answer-first, which helps when dense AI papers or course lessons throw unfamiliar jargon at you.
Are there cheat sheets for interview preparation?
Cheat sheets work well as interview-day refreshers because they compress syntax, commands and key concepts into scannable references. For dedicated preparation, combine them with the SkillVeris interview questions feature, which includes readiness scoring, plus study notes for depth. Reviewing a relevant cheat sheet just before an interview steadies recall under pressure.
Can I read the tech blog without signing up?
Yes, the blog is freely readable, and SkillVeris never charges for content. All 500-plus articles are open, covering tutorials, concept explainers and career advice. Creating a free account adds value elsewhere on the platform, like course progress tracking and certificates, but reading the blog requires no commitment at all.
How is the SkillVeris glossary different from Wikipedia?
The glossary is purpose-built for learners: definitions are short, plain-language and answer-first, sized for a quick lookup mid-lesson rather than a deep encyclopedic read. Entries also cross-link to related SkillVeris study notes, blog posts and courses, so a definition becomes a doorway into structured learning instead of a dead end.
Do blog articles use the Learn Through Hobbies method?
Many blog articles teach technical topics through hobby analogies, a hallmark of the SkillVeris blog, so you will find articles explaining programming through cricket, machine learning through music, or system design through cooking. The analogy is the teaching device; the article still delivers the real technical concept underneath.
Where can I find quick programming references while coding?
Open the SkillVeris cheat sheets, which are built exactly for that moment: compact, scannable references for syntax, commands and common patterns across languages and tools. Keep the relevant sheet in a browser tab while you work in Code Lab or your own editor, and dip into the glossary for terminology.
Is there a glossary entry for terms I meet in job descriptions?
Very likely yes, with roughly 2,000-plus terms across AI, programming, web, DevOps, cloud, security and databases, the glossary covers most jargon that appears in tech job descriptions. Decoding a listing this way helps you judge role fit honestly and prepares you to discuss those terms in interviews.
Are the blog articles written for the Indian tech audience?
The blog serves Indian learners plus a worldwide audience. Content stays globally relevant while acknowledging realities that matter in India, such as free access being essential for students and freshers, and career guidance that connects naturally to the SkillVeris jobs portal, which aggregates roles across India, UK, USA, Germany and Remote.
Can I suggest a topic for the blog or glossary?
SkillVeris content grows in response to what learners need, so feedback is welcome through the platform's support channels. If a term is missing from the glossary or a topic deserves an article, telling the team helps prioritise it. Meanwhile, the AI Mentor can answer the question immediately, 24/7, at any depth.
Do cheat sheets and glossary entries link to deeper learning?
Yes, every cheat sheet and glossary entry carries related reading links into study notes, blog articles and courses, plus concept hashtags for discovering similar content. This cross-linking means a thirty-second lookup can smoothly become a structured learning session whenever you decide you want more than a quick answer.
What makes SkillVeris programming references trustworthy?
The references are written to strict internal quality standards, kept consistent with the platform's 37 live courses, and never padded with invented statistics or hype. Definitions and cheat sheets are reviewed against the same content contracts that govern courses, and the answer-first style makes any inaccuracy easy to spot and correct.
How do the blog, glossary and cheat sheets fit into my learning routine?
Use them as satellites around your main course: read blog articles for context and motivation, hit the glossary the instant jargon appears, and keep cheat sheets open while coding. Together with study notes, Code Lab and the 24/7 AI Mentor, they turn passive reading into a complete, free learning system.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse