Technology is at the heart of modern economies, driving industrial growth, reshaping communication, and fueling innovation at an unprecedented pace. Over the past five years, the global tech sector has experienced rapid advancements in artificial intelligence, cloud computing, fintech, and semiconductors. At the same time, geopolitical tensions, regulatory changes, and economic downturns have introduced significant volatility.
In this post, I demonstrate how simple data analysis using Python can help uncover trends and interpret economic events shaping the tech sector. Using data from Yahoo Finance, I analyze the performance of various countries over the past five years, highlighting key insights through visualizations. By creating a custom dataset and generating a treemap and a dual-axis bar chart, we can explore growth patterns, anomalies, and contrasting performances of major players in the tech industry. This approach not only provides a clear picture of the sector’s trajectory but also shows how easily economic analysis can be conducted using Python.
Data Source and Methodology
The dataset that we will to create these charts will be sourced from Yahoo Finance using the yfinance
Python library. A script will be used to fetch historical data for tech-related stock indices across various countries over a five-year period. Here’s a simple guide to help you generate a dataset similar to the one used in this analysis.
Step 1: Install Required Libraries
Ensure you have Python installed and install the necessary packages:
pip install yfinance pandas
Step 2: Define Tech Indices
Each country has specific stock indices representing its tech sector. For example:
- USA → Nasdaq-100 (
^NDX
) - India → Nifty IT (
^CNXIT
) - Germany → DAX Index (
^GDAXI
)
You can extend this list based on your research.
Step 3: Fetch Data Using Python
Here’s a basic script to retrieve 5-year performance data:
import yfinance as yf
import pandas as pd
# Define tech indices for different countries
tech_indices = {
"USA": "^NDX",
"India": "^CNXIT",
"Germany": "^GDAXI",
}
# Function to calculate performance
def get_tech_performance(ticker):
stock = yf.Ticker(ticker)
hist = stock.history(period="5y") # Fetch 5-year data
if hist.empty:
return None
return round((hist["Close"][-1] - hist["Close"][0]) / hist["Close"][0] * 100, 2)
# Collect data
data = []
for country, ticker in tech_indices.items():
performance = get_tech_performance(ticker)
data.append([country, performance])
df = pd.DataFrame(data, columns=["Country", "Tech Sector Performance (%)"])
df.to_csv("tech_sector_performance.csv", index=False)
print(df)
Step 4: Interpret the Results
- A positive percentage indicates growth in the country’s tech sector over five years.
- A negative percentage suggests a decline due to market factors, regulations, or economic downturns.
So, each country’s tech index data was retrieved, and the percentage change over the five-year period was calculated based on the closing prices of the first and last trading days within that timeframe. After the dataset was created we can move forward with our analysis using visualizations.
Understanding the Charts
The dataset was visualized using Plotly.js within an HTML file. The data was first processed in Python, formatted into a usable structure, and then integrated into an HTML page with JavaScript to render interactive charts. The process is relatively simple and can be explored further through online guides or future discussions. As of now let’s discuss the visualizations that were created using the dataset.
The first visualization is a treemap illustrating the relative performance of different countries in the tech sector. Each country’s contribution is represented by the size of the rectangle, while the color intensity indicates performance levels. India leads the pack with a tech sector performance of 158.45% over five years, followed closely by the USA at 135.82%. Other significant contributors include Japan (68.25%) and Germany (60.85%), while Brazil shows the lowest positive performance at 6.51%.
Data Source: yahoo finance
The bar chart below, distinguishes between positive and negative performances. Countries like India, USA, Germany, Japan, and Canada demonstrate positive growth over the five-year period, while China is the only major economy with a negative performance of -25.57%. This contrast suggests economic or regulatory challenges that is currently affecting China’s tech sector, potentially due to ongoing geopolitical tensions, strict government regulations, or market fluctuations.
Data Source: yahoo finance
Key Insights and Interpretation
1. India’s Tech Boom: 158.45% Growth Over Five Years
India’s 158.45% tech growth stems from strong government initiatives like “Digital India,” a booming startup ecosystem, and increased foreign investments. The rise of IT giants (TCS, Infosys), fintech innovations (UPI, Paytm), and post-pandemic digital acceleration have fueled this expansion, attracting global venture capital and tech collaborations.
2. USA’s Sustained Tech Dominance: 135.82% Growth
The USA maintains dominance with companies like Apple, Microsoft, and Google leading AI, cloud computing, and semiconductors. Policies like the CHIPS and Science Act (2022) support domestic tech production, while AI advancements (e.g., ChatGPT) and cloud market expansion bolster consistent sector growth.
3. China’s Decline: -25.57% Performance Over Five Years
China’s negative performance results from strict regulatory crackdowns on tech firms (Alibaba, Tencent), U.S.-China trade tensions, and semiconductor restrictions. Stringent data security laws, economic slowdowns, and prolonged COVID-19 lockdowns have further dampened investor confidence and market stability.
4. Germany and Japan: Steady Growth Amid Strategic Investments
Germany (60.85%) benefits from Industry 4.0 automation and the EU’s Digital Decade strategy, while Japan (68.25%) thrives on robotics, AI, and semiconductor innovation under its Society 5.0 framework. Both nations prioritize R&D and tech-driven industrial transformation to sustain growth.
5. The UK and Canada: Diversified Tech Growth
The UK leverages fintech leadership (Revolut, Monzo) and AI innovation to drive sector expansion, despite Brexit-related uncertainties. Canada (45.25%) thrives on its AI research hubs (Toronto, Montreal) and government-backed strategies like the Pan-Canadian AI Strategy, attracting global talent and investments.
6. Brazil’s Slow Growth: 6.51% Increase Over Five Years
Brazil’s modest tech growth stems from structural challenges, political instability, and limited foreign investment. However, fintech innovations like Nubank and growing e-commerce adoption signal potential for long-term expansion despite infrastructural hurdles.
Conclusion
The global tech sector reflects an interplay of innovation, policies, and economic factors. India and the USA lead due to digital infrastructure and investment-friendly policies, while China struggles with regulatory hurdles. Germany, Japan, the UK, and Canada sustain steady growth through AI, fintech, and R&D investments. Future trends in AI, quantum computing, and green technology will define the sector’s trajectory.