A Business Analytics project combining Python, yfinance (Real NSE Data), and Power BI to evaluate top Indian companies using historical stock prices, fundamental ratios, risk metrics, and news sentiment.
Analyze the performance of 10 major NSE-listed companies and generate data-driven investment insights through an interactive Power BI dashboard.
| Company | NSE Ticker | Sector |
|---|---|---|
| Reliance Industries | RELIANCE.NS | Energy & Retail |
| TCS | TCS.NS | Information Technology |
| Infosys | INFY.NS | Information Technology |
| HDFC Bank | HDFCBANK.NS | Banking |
| ICICI Bank | ICICIBANK.NS | Banking |
| SBI | SBIN.NS | Banking |
| ITC | ITC.NS | FMCG |
| Bharti Airtel | BHARTIARTL.NS | Telecom |
| Larsen & Toubro | LT.NS | Infrastructure |
| Hindustan Unilever | HINDUNILVR.NS | FMCG |
| Category | Tools |
|---|---|
| Data Collection | yfinance (Real NSE/BSE Data) |
| Data Processing | Python 3, Pandas, NumPy |
| Visualization | Matplotlib, Power BI |
| Data Storage | CSV Files |
Indian_Stock_Market_Analysis/
β
βββ dashboard.pbix β Power BI Dashboard
β
βββ stock_prices.csv β Real NSE price data (3,650+ records)
βββ company_fundamentals.csv β PE, Dividend, ROE, Market Cap
βββ news_sentiment.csv β Sentiment scores (500+ records)
βββ investment_ranking.csv β Final ranking output
β
βββ charts/
β βββ investment_score.png
β βββ sentiment_score.png
β βββ pe_vs_dividend.png
β βββ price_trends.png
β βββ returns_comparison.png
β βββ volatility.png
β
βββ generate_dataset.py β Fetches real data from NSE via yfinance
βββ analysis.py β Core analytical logic + investment scoring
βββ charts.py β Chart generation
β
βββ requirements.txt
βββ README.md
- Average Closing Price
- Total Market Capitalization
- Average PE Ratio
- Overall Sentiment Score
- Normalized Stock Price Trend
- PE Ratio Comparison
- Dividend Yield Analysis
- Market Cap Distribution
- ROE (Return on Equity) Comparison
- Sector-wise Performance
- Average News Sentiment Score per company
- Positive vs Negative vs Neutral Distribution
- Overall Market Sentiment Indicator
Investment Score Formula:
Investment Score =
(Sentiment Score Γ 30)
+ (ROE % Γ 0.3) β Profitability
+ (Dividend Yield Γ 5) β Income Generation
+ (1 / PE_Ratio Γ 10) β Valuation (Lower PE = Better)
- (Volatility % Γ 0.2) β Risk Penalty
Companies ranked on: Sentiment + Profitability + Valuation + Income β Risk
| Dataset | Columns | Records |
|---|---|---|
| stock_prices.csv | Date, Company, Ticker, Open, High, Low, Close, Volume | 3,650+ |
| company_fundamentals.csv | Company, Sector, Market Cap, PE Ratio, Dividend Yield, EPS, ROE, 52W High/Low | 10 |
| news_sentiment.csv | Date, Company, Headline, Sentiment Score, Sentiment | 500+ |
Note: Stock price data is fetched in real-time from NSE via
yfinance. Last 3 years of data (2022β2025).
git clone https://github.com/shekhu24-bit/Indian-Stock-Market-Analysis.git
cd Indian-Stock-Market-Analysispip install -r requirements.txtpython generate_dataset.pypython analysis.pypython charts.pyOpen dashboard.pbix β Click Home β Refresh
- HDFC Bank ranked #1 with highest investment score due to strong fundamentals and positive sentiment
- Bharti Airtel leads in news sentiment positivity
- Reliance Industries offers the best valuation (lowest PE Ratio)
- Banking sector shows the most balanced PE and Dividend combination
- ~61.8% of all news coverage was positive across companies
- TCS and Infosys show lowest volatility (suitable for risk-averse investors)
- π Investment Research & Portfolio Evaluation
- π Financial Analytics Reporting
- π Sector Performance Benchmarking
- π MBA Business Analytics Capstone Projects
- π Power BI Dashboard Development Practice
- Real financial data extraction (yfinance / NSE)
- Data Cleaning and Feature Engineering
- Financial Ratio Analysis (PE, ROE, Dividend Yield)
- Volatility & Risk Measurement (Annualized Std Dev)
- Sentiment Analysis (Scoring Framework)
- Max Drawdown Calculation
- Matplotlib Chart Generation (6 chart types)
- Power BI KPI Design & Dashboard Development
- Business Decision-Making from Data
This project demonstrates how Python-based analytics and Power BI dashboards can transform real NSE market data into actionable investment insights. By integrating price history, company fundamentals, risk metrics, and market sentiment into a composite Investment Score, the dashboard provides a structured framework for comparing stocks across sectors.
Shekhar Tanwar MBA β Finance & Business Analytics | Maharshi Dayanand University, Rohtak





