← Blog
PYTHON LIBRARIES · DATA ANALYSIS · INDIA 2026

Python Libraries for Data Analysis India 2026
Pandas, NumPy, Matplotlib, Seaborn, Plotly & More — With Code

Every Python library a data analyst in India needs to know — what it does, when to use it over alternatives, and real code examples on Indian business data. Learn the right library for each task instead of trying to memorise all of them at once.

pandasNumPyMatplotlibSeabornPlotlyScikit-learnSQLAlchemy + psycopg2
Live Python Training →
Learning priority order for data analyst jobs in India
1. pandas2. NumPy3. Matplotlib4. Seaborn5. SQLAlchemy6. Plotly7. Scikit-learn

pandas

Data ManipulationEssential — learn first

The foundation of data analysis in Python. pandas provides the DataFrame — a table-like structure that makes loading, cleaning, transforming, and aggregating data intuitive. If you know Excel pivot tables and VLOOKUP, pandas is the programmatic equivalent — but faster, reproducible, and handles millions of rows easily.

KEY USE CASES
Read CSV, Excel, SQL databases into DataFrames
Filter rows, select columns, sort, rename
GroupBy aggregation (equivalent of Excel SUMIFS/pivot)
Merge DataFrames (equivalent of VLOOKUP/SQL JOIN)
Handle missing values, duplicate removal, type conversion
Apply functions to columns for custom transformations
import pandas as pd

# Load Indian sales data
df = pd.read_csv('sales_india.csv')

# Clean: remove duplicates, fix amount column
df = df.drop_duplicates()
df['amount'] = df['amount'].str.replace('₹', '').str.replace(',', '').astype(float)

# GroupBy — total sales per city per month
summary = df.groupby(['city', 'month'])['amount'].sum().reset_index()

# Filter — top cities above ₹10L
top_cities = summary[summary['amount'] > 1000000]

# Merge — add region from lookup table
regions = pd.read_csv('city_regions.csv')
result = top_cities.merge(regions, on='city', how='left')
print(result.head())

NumPy

Numerical ComputingEssential (used alongside pandas)

NumPy provides fast numerical arrays and mathematical operations. You will use it directly less often than pandas, but it underpins pandas and is used whenever you need array operations, mathematical functions, or random number generation. Knowing numpy fills gaps when pandas alone is not efficient enough.

KEY USE CASES
Array operations (vectorised, no loops)
Statistical calculations — mean, std, percentile
Random number generation for simulations
Matrix operations for ML preprocessing
np.where() — conditional logic on arrays
import numpy as np

amounts = np.array([15000, 82000, 3500, 120000, 47000, 9000])

# Statistical summary
print(f"Mean:   ₹{np.mean(amounts):,.0f}")
print(f"Median: ₹{np.median(amounts):,.0f}")
print(f"Std:    ₹{np.std(amounts):,.0f}")
print(f"75th %: ₹{np.percentile(amounts, 75):,.0f}")

# Conditional: flag high-value orders
category = np.where(amounts > 50000, 'High Value', 'Standard')
print(category)
# → ['Standard' 'High Value' 'Standard' 'High Value' 'Standard' 'Standard']

# Clip outliers to ₹1L cap
capped = np.clip(amounts, 0, 100000)

Matplotlib

Data VisualisationEssential — for reports and presentations

The foundational Python plotting library. Every other visualisation library builds on top of Matplotlib. It gives you complete control over every chart element — axes, ticks, colours, annotations, figure size. The trade-off is more code for standard charts. Use Matplotlib when you need precise, publication-quality static charts.

KEY USE CASES
Bar charts, line charts, scatter plots, histograms
Multi-panel (subplot) layouts
Custom annotations, arrows, text overlays
Save as PNG/PDF for reports and presentations
Dual-axis charts for different scales
import matplotlib.pyplot as plt
import pandas as pd

months = ['Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep']
revenue = [42, 58, 51, 67, 73, 61]   # ₹ Lakhs
target  = [50, 55, 60, 65, 70, 75]

fig, ax = plt.subplots(figsize=(9, 4))

ax.bar(months, revenue, color='#1d4ed8', alpha=0.8, label='Actual Revenue')
ax.plot(months, target, color='#FF6B00', marker='o',
        linewidth=2, linestyle='--', label='Target')

ax.set_title('Monthly Revenue vs Target — FY 2026 (₹ Lakhs)', fontsize=13)
ax.set_ylabel('₹ Lakhs')
ax.legend()
ax.grid(axis='y', alpha=0.3)

plt.tight_layout()
plt.savefig('revenue_vs_target.png', dpi=150)
plt.show()

Seaborn

Statistical VisualisationHigh — for EDA and statistical plots

Seaborn makes beautiful statistical visualisations with minimal code. It is the go-to library for exploratory data analysis — understanding distributions, correlations, and relationships between variables. Seaborn charts look professional by default and integrate directly with pandas DataFrames.

KEY USE CASES
Distribution plots — histograms with KDE curves
Heatmaps — correlation matrices, pivot summaries
Box plots — outlier detection by category
Pair plots — relationships between all numeric columns
Regression plots — trend lines with confidence intervals
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd

df = pd.read_csv('employee_data.csv')
# columns: department, salary, experience_years, attrition

# Correlation heatmap
fig, axes = plt.subplots(1, 2, figsize=(12, 4))

numeric_cols = df[['salary', 'experience_years', 'age', 'performance_score']]
sns.heatmap(numeric_cols.corr(), annot=True, fmt='.2f',
            cmap='Blues', ax=axes[0])
axes[0].set_title('Correlation Matrix')

# Box plot — salary by department
sns.boxplot(data=df, x='department', y='salary',
            palette='Set2', ax=axes[1])
axes[1].set_title('Salary Distribution by Department')
axes[1].tick_params(axis='x', rotation=45)

plt.tight_layout()
plt.savefig('eda_charts.png', dpi=150)

Plotly

Interactive VisualisationMedium — for interactive dashboards

Plotly creates interactive charts — hover for values, click to filter, zoom in, pan. Essential if you build Python dashboards (Plotly Dash or Streamlit) or share interactive analysis in Jupyter notebooks. Plotly Express provides a simple API for most chart types; Plotly Graph Objects gives full control for complex visualisations.

KEY USE CASES
Interactive bar, line, scatter charts
Animated charts (time series with play button)
Choropleth maps for India state/city data
Sunburst and treemap charts for hierarchical data
Plotly Dash dashboards — share via web browser
import plotly.express as px
import pandas as pd

df = pd.read_csv('india_state_sales.csv')
# columns: state, revenue, category, year

# Interactive bar chart — hover shows exact values
fig = px.bar(df[df['year'] == 2026],
             x='state', y='revenue',
             color='category',
             title='Revenue by State — India 2026',
             labels={'revenue': 'Revenue (₹ Cr)', 'state': 'State'},
             color_discrete_sequence=px.colors.qualitative.Set2)

fig.update_layout(xaxis_tickangle=-45)
fig.write_html('india_revenue.html')  # Share as interactive HTML
fig.show()

# Choropleth map — India state-level data
fig2 = px.choropleth(df[df['year'] == 2026],
                     geojson='india_states.geojson',
                     locations='state',
                     color='revenue',
                     title='Revenue Heatmap — India 2026')
fig2.show()

Scikit-learn

Machine LearningMedium — for data science roles

The standard Python machine learning library. For data analyst roles, the most useful scikit-learn features are preprocessing (scaling, encoding), train-test splitting, and basic models (linear regression, decision tree, clustering). Full ML model building is data science territory, but every analyst benefits from understanding the workflow.

KEY USE CASES
Linear regression for forecasting
K-means clustering for customer segmentation
Label encoding and one-hot encoding for categorical data
Standard scaling for normalising numeric features
Train-test split and cross-validation basics
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score, mean_absolute_error
from sklearn.preprocessing import StandardScaler
import pandas as pd

df = pd.read_csv('sales_forecast.csv')
# Predict next month revenue from marketing spend, region, product category

X = df[['marketing_spend', 'region_encoded', 'category_encoded']]
y = df['revenue']

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42)

scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)

model = LinearRegression()
model.fit(X_train_scaled, y_train)

y_pred = model.predict(X_test_scaled)
print(f"R² Score: {r2_score(y_test, y_pred):.3f}")
print(f"MAE:      ₹{mean_absolute_error(y_test, y_pred):,.0f}")

SQLAlchemy + psycopg2

Database ConnectionHigh — for production data pipelines

In real analyst work, data rarely comes from CSV files — it comes from databases. SQLAlchemy is the standard Python library for connecting to MySQL, PostgreSQL, and SQL Server. Combined with pandas read_sql(), you can run SQL queries and load results directly into DataFrames without any export step.

KEY USE CASES
Connect to MySQL, PostgreSQL, SQL Server from Python
Run SQL queries and load results into pandas DataFrames
Write DataFrames back to database tables
Automate monthly data pulls without manual CSV export
import pandas as pd
from sqlalchemy import create_engine

# Connect to MySQL database (common in Indian companies)
engine = create_engine(
    'mysql+pymysql://username:password@localhost:3306/sales_db'
)

# Run SQL query → directly into pandas DataFrame
query = """
    SELECT
        city,
        DATE_FORMAT(order_date, '%Y-%m') AS month,
        SUM(amount)                       AS total_revenue,
        COUNT(*)                          AS order_count
    FROM orders
    WHERE order_date >= '2026-04-01'
    GROUP BY city, month
    ORDER BY month, total_revenue DESC
"""

df = pd.read_sql(query, engine)
print(df.head(10))

# Write cleaned data back to a results table
df_cleaned.to_sql('monthly_summary', engine,
                  if_exists='replace', index=False)
Continue learning Python
Python Tutorial — BeginnersPython Interview Q&ASQL TutorialPython + GenAI

Frequently Asked Questions

Which Python library should a data analyst learn first in India?

Start with pandas. It is the foundation of almost all data analysis in Python — loading CSVs, cleaning data, filtering rows, grouping, merging tables, and exporting results. Every other library builds on top of pandas DataFrames. NumPy comes alongside pandas naturally (pandas uses NumPy internally). Once you can do basic pandas operations confidently, add Matplotlib for plotting, then Seaborn for statistical visualisation. Scikit-learn comes after these once you are comfortable with the data preparation workflow.

Is pandas enough for a data analyst job in India?

Strong pandas skills combined with SQL and a BI tool (Power BI or Tableau) are sufficient for most data analyst roles in India. Many job descriptions list "Python/pandas" as a skill, and the practical assessment typically involves reading a CSV, cleaning it, and producing a grouped summary or a chart — all achievable with pandas and Matplotlib alone. NumPy, Seaborn, and Plotly add value and are worth learning, but they are secondary to pandas proficiency. Scikit-learn is needed for data science and ML roles, not pure data analyst roles.

What is the difference between Matplotlib and Seaborn in Python?

Matplotlib is the foundational plotting library — it gives you complete control over every element of a chart but requires more code for professional-looking results. Seaborn is built on top of Matplotlib and provides higher-level functions for statistical visualisations (distribution plots, heatmaps, pair plots, regression plots) with much less code and better default styling. For data analysis work, use Seaborn for exploratory analysis and statistical plots; use Matplotlib for fine-tuned customisation and when you need full control. Both are worth knowing — Seaborn for speed, Matplotlib for precision.

Should data analysts in India learn Plotly or Matplotlib?

Both serve different purposes. Matplotlib produces static charts (PNG/PDF) suitable for reports and presentations. Plotly produces interactive charts (hover, zoom, filter) suitable for web dashboards and Jupyter notebooks. For most data analyst jobs in India, Matplotlib and Seaborn are sufficient. Plotly is valuable if you build dashboards in Python (using Plotly Dash) or need interactive EDA in notebooks. If your company uses Streamlit for internal tools or dashboards, Plotly is the natural partner. Learn Matplotlib and Seaborn first, then add Plotly if your role involves interactive reporting.

EVIKA ACADEMY · NOIDA SECTOR 51 · LIVE PYTHON TRAINING

Learn Python for Data Analysis — Live, with Real Indian Datasets

pandas, NumPy, Matplotlib, Seaborn, and SQL — all in one curriculum. Project-based. Interview-ready. Free demo class first.

Book Free Demo →