Python
Getting Started with Python for Data Science
A practical beginner guide to Python for data science: setup, the basics that matter, NumPy, Pandas, visualisation, a first analysis and a 6-week plan.
Why Python for data science?
Python is the most widely used language for data science, analytics and AI. It reads almost like English, so beginners can focus on solving problems instead of fighting syntax, and it has a huge ecosystem of libraries for every step of data work — from loading a spreadsheet to training a neural network or calling a large language model.
This guide shows you what to install, the Python basics you actually need, the core data libraries, a first mini-analysis, and a learning plan.
Step 1: Set up your tools
The easiest way to start is with Jupyter Notebook or JupyterLab, which let you run code in small cells and see results immediately. You can install Python with the Anaconda distribution, or use a free browser-based notebook such as Google Colab so you don't need to install anything at all.
Step 2: Learn the Python basics that matter for data
You don't need to learn every feature of Python before working with data. Focus on:
- Variables and data types — numbers, strings, booleans
- Lists and dictionaries — the structures you'll use constantly
- Conditions and loops —
if,for,while - Functions — reusable blocks of logic
- List comprehensions — compact ways to transform data
- Reading files — CSV and text files
- Basic error handling —
tryandexcept
prices = [120, 450, 89, 300]
discounted = [p * 0.9 for p in prices if p > 100]
print(discounted) # [108.0, 405.0, 270.0]
Step 3: Learn the core data libraries
NumPy — fast numerical computing
NumPy provides arrays that are much faster than Python lists for maths on large amounts of numbers. Most other data libraries are built on top of it.
Pandas — working with tables
Pandas is the library you'll use most. Its DataFrame is like a spreadsheet you control with code: load data, filter rows, select columns, handle missing values, group, aggregate and merge tables.
import pandas as pd
sales = pd.read_csv("sales.csv")
print(sales.head())
# Revenue by city, highest first
by_city = sales.groupby("city")["revenue"].sum().sort_values(ascending=False)
print(by_city)
Matplotlib and Seaborn — visualisation
Charts help you spot patterns and explain findings. Matplotlib gives full control; Seaborn makes attractive statistical charts with less code.
import matplotlib.pyplot as plt
by_city.plot(kind="bar", title="Revenue by city")
plt.tight_layout()
plt.show()
Scikit-learn — machine learning
Once you're comfortable with Pandas, Scikit-learn lets you train models for prediction and classification with a consistent, beginner-friendly interface.
Step 4: Do a small end-to-end analysis
Pick a simple public dataset — sales, movies, cricket scores or weather — and answer three questions:
- Load and inspect — how many rows and columns? Which values are missing?
- Clean — fix data types, remove duplicates and handle missing values.
- Explore — use
groupby,describe()and a few charts to find patterns. - Summarise — write three clear findings in plain language.
Publishing a notebook like this on GitHub is the first step towards a portfolio.
Common beginner mistakes
- Trying to memorise syntax instead of building small projects
- Skipping data cleaning — real data is always messy
- Copying code without understanding what each line does
- Learning Python alone and avoiding SQL — you'll need both
- Not writing down what you found; communication matters
A 6-week learning plan
- Week 1: Python basics — variables, lists, dictionaries, loops, functions.
- Week 2: Files, comprehensions and error handling; small practice problems daily.
- Week 3: NumPy and Pandas — loading, filtering, grouping and merging data.
- Week 4: Visualisation with Matplotlib and Seaborn; your first exploratory analysis.
- Week 5: SQL basics alongside Pandas — the same questions answered both ways.
- Week 6: A mini project end to end, published on GitHub.
For a longer plan, see our Data Science Roadmap 2026 and the Python for Data guide.
Learn Python for data in KPHB, Hyderabad
At The Data School in KPHB Colony, Kukatpally, Python is taught from scratch as the foundation of our Data Science and Data Analytics programs — the way data professionals actually use it. Learn in our classroom, live online or hybrid. See the Python course in KPHB page, or book a free demo class.