Chapters:
Synkoc DS Internship · Week 1 · Lesson 1.1 of 24
Welcome to Python for Data Science
Before pandas. Before scikit-learn. Before any ML model — every working data scientist in India writes Python every day. This 30-minute lesson covers what a fresher needs to think in Python like a data scientist.
🐍 Python Foundations
🎓 Fresher-friendly
⚡ 7 core concepts
⏱ 30 Minutes
👨‍🏫
Synkoc Instructor
Data Science Trainer · Bangalore
⏱ ~30 minutes
🟢 Beginner Level
By the end of this lesson, you will be able to...
📓
Work confidently in a Jupyter notebook
Run cells with Shift+Enter, understand In[N] and Out[N], add markdown notes, and structure your analysis the way real data scientists do.
🔢
Use Python’s four basic types
Integers, floats, strings, and booleans — know which is which, and how to check with the type() function.
📒
Build lists and dictionaries
The two collections you reach for every day in data science. Indexing, slicing, adding, looking up by key.
Write functions, loops, and imports
The control-flow basics that turn one-off scripts into reusable code — plus your first “import pandas as pd”.
Chapter 1
Why Python is the language of DS
In 2026, with no-code ML platforms everywhere, you might wonder — why are we starting with code? Because every Indian data science role requires it. pandas, scikit-learn, TensorFlow — all Python. Master it first.
Python vs. The Other Tools
ToolBest ForWhere Synkoc DS Uses It
PythonLoading, cleaning, EDA, modelling, deploymentEvery week (Weeks 1–6)
SQLQuerying large databases that don’t fit on RAMWeek 3 alongside Python
RStatistical computing, popular in academia/pharmaNot in this course
Tableau / Power BIDashboards and executive reportsOptional add-on
ExcelAd-hoc work, quick sanity checksSome days, even for DS
💡 The reality: A working DS uses Python for ~90% of their day, SQL to pull the data, and Tableau/Excel for the polished output. They're not competitors — Python is the engine.
Three reasons Python wins
📚
Unmatched libraries
pandas for data, scikit-learn for ML, TensorFlow/PyTorch for deep learning. No other language has this depth of free, battle-tested tools.
📖
Readable like English
Python code reads almost like prose. A fresher can read someone else’s pandas code and understand it. Huge for team work.
💼
The hiring standard
Every DS job description in India lists Python first. SQL is secondary. R is rare. Python is the entry ticket.
Chapter 2
A Tour of the Jupyter Notebook
When you open Jupyter for the first time, the cells, the In and Out brackets, the kernel busy indicator — it can feel like a foreign tool. Let me walk you through every piece. By the end, you’ll know exactly what each part does.
A notebook = cells of three kinds
🐍
Code cells
Where you write and run Python. Each cell has In[N] on the left. Run with Shift+Enter. The output appears below as Out[N].
📝
Markdown cells
Where you write headings, paragraphs, bullet points. Renders as formatted text. Use these to tell the story around your code.
📄
Raw cells
Unprocessed text. As a beginner, you’ll rarely use these. Mention them once, move on.
The 10 Jupyter shortcuts you’ll actually use
Shift+Enter
Run cell + move to next. Your most-used shortcut.
Ctrl+Enter
Run cell, stay there. For iterating.
Alt+Enter
Run cell + new cell below.
A
Insert above
Press A in command mode.
B
Insert below
Press B in command mode.
M
Cell → Markdown
Convert current cell to markdown.
Y
Cell → Code
Convert back to code cell.
DD
Delete cell
Press D twice (in command mode).
Esc
Command mode
Exit edit mode — then shortcuts work.
Enter
Edit mode
Enter the cell to type into it.
Chapter 3
Variables and the Four Types
In Python, you don’t declare types. age = 25 creates a variable called age, holding the integer 25. Python figures out the type for you. This is why beginners get productive in days, not weeks.
The four basic types
🔢
int — whole number
age = 25
Used for counts, indices, IDs, years.
💰
float — decimal
price = 99.99
Used for prices, scores, probabilities.
📝
str — text
name = "Priya"
Single or double quotes, both fine.
bool — true/false
is_active = True
Capital T, capital F. Used everywhere in conditions.
Variables in action
# Assign (single =) age = 25 name = "Priya" is_active = True # Compare (double ==) age == 25 # True name == "Arjun" # False # Print using an f-string (modern Python) print(f"{name} is {age} years old") # → Priya is 25 years old
⚠️ The #1 beginner mistake: writing if age = 25 instead of if age == 25. Single = assigns. Double == compares.
Chapter 4
Lists and Dictionaries
The two collections you reach for every day in data science. A list holds many values in order. A dictionary holds many values by name. Master both, and pandas will make sense almost immediately.
Lists — values in order
# Create a list cities = ["Mumbai", "Delhi", "Pune"] # Access by index — Python starts at 0 cities[0] # Mumbai cities[1] # Delhi cities[-1] # Pune (negative = from end) # Add to a list cities.append("Bengaluru") # How many items? len(cities) # 4
⚠️ Zero-indexing: the first item is index 0, not 1. This trips up every fresher — lock it in now and save yourself hours of bugs.
Dictionaries — values by name
# Create a dictionary person = { "name": "Priya", "age": 25, "city": "Mumbai" } # Access by key person["name"] # Priya person["age"] # 25 # Add or update a key person["phone"] = "+91 9876..." # All keys, all values person.keys() # dict_keys([...]) person.values() # dict_values([...])
💡 Why dictionaries matter: every API on the internet returns a dictionary. Every JSON object is a dictionary. Every row in a pandas DataFrame can be expressed as one. They’re everywhere.
List vs Dictionary — which to pick
Use a list when...Use a dictionary when...
Many things of the same kind, in orderOne thing with several attributes
Column of cities, sequence of order IDsOne customer record, one product detail
You loop through all itemsYou look up by name
Order matters, position mattersName matters, position doesn’t
🔗 They combine naturally: a list of dictionaries is the most common data shape — each dict is a row, each key is a column. pd.DataFrame(records) reads exactly this.
Chapter 5
Control Flow — if, else, for
The three building blocks that turn a list of statements into real logic. if makes decisions. for repeats. Master these two and you can write almost any Python you need for data science.
if / elif / else — the decision pattern
score = 78 if score >= 90: grade = "A" elif score >= 75: grade = "B" elif score >= 60: grade = "C" else: grade = "F" print(grade) # B
⚠️ Indentation matters: Python uses spaces to know what’s inside the if. Pick 4 spaces, use them everywhere, never mix with tabs. Most IDEs do this for you.
for loops — the workhorse
cities = ["Mumbai", "Delhi", "Pune"] # Print each city for city in cities: print(city) # Loop over a range of numbers for i in range(5): # 0, 1, 2, 3, 4 print(i) # Loop over a dictionary person = {"name": "Priya", "age": 25} for key, value in person.items(): print(key, ":", value)
🔄 You’ll write “for” thousands of times: looping through rows, files, keys, batches. It’s the most-used control structure in DS.
Chapter 6
Functions — reusable code
Instead of copy-pasting the same code ten times, wrap it in a function. Give it a name. Call it. This single habit separates beginner code from professional code.
Defining a function
def calculate_average(numbers): total = sum(numbers) count = len(numbers) return total / count # Call it as many times as you want calculate_average([10, 20, 30]) # 20.0 calculate_average([85, 90, 92]) # 89.0
💡 Rule of thumb: if you find yourself copy-pasting the same 3+ lines twice, turn them into a function. Your future self will thank you.
Four function rules worth knowing
🎁
Default arguments
def greet(name="there"): — name is optional. Call greet() and it uses “there”.
🏷️
Named arguments
greet(name="Priya") is clearer than relying on position. Use named for any function with more than 2 args.
↩️
Returning nothing
A function without a return returns None implicitly. Useful for functions that print or save side effects.
🔒
Local variables
Variables inside a function don’t leak out. This makes functions safe to call — they don’t pollute your notebook.
Chapter 7
Imports and Libraries
Python’s standard library is small. Its third-party libraries are vast and free. We bring them in with import. The single line import pandas as pd is the most-typed code in data science.
The three forms of import
# 1. Import the whole library (use dot notation) import pandas pandas.read_csv("data.csv") # 2. Import with a nickname (the standard for big libraries) import pandas as pd pd.read_csv("data.csv") # 3. Import a specific function (no prefix needed) from sklearn.linear_model import LinearRegression model = LinearRegression()
💡 Standard conventions: import pandas as pd, import numpy as np, import matplotlib.pyplot as plt. Every data scientist uses these exact aliases. Stick to them.
The 5 libraries you’ll meet in this course
📊
NumPy — fast arrays
import numpy as np
Foundation of everything else. Numerical operations at C-speed.
🐼
pandas — the DataFrame
import pandas as pd
The spreadsheet of Python. Load, clean, transform real data.
📈
matplotlib / seaborn
import matplotlib.pyplot as plt
Charts and visualisation. Histograms, scatter, heatmap.
🧠
scikit-learn
from sklearn... import ...
Every classical ML algorithm with one consistent API.
🤖
TensorFlow / Keras
from tensorflow.keras... import ...
Deep learning. Neural networks in 5 lines.
💾
Many more
requests for APIs, beautifulsoup for scraping, streamlit for apps. The Python ecosystem is huge.
Chapter 8
Wrap Up & Next Steps
A quick recap of everything you learned today. What to practise this week. And what’s coming up in Lesson 1.2 — where we start using NumPy and arrays.
Today’s recap — 7 concepts
📓
Jupyter notebook
Code cells, markdown cells, In[N]/Out[N], 10 shortcuts
🔢
4 basic types
int, float, str, bool — check with type()
📒
Lists
Values in order, zero-indexed, append to add
🔑
Dictionaries
Values by key, the foundation of JSON & APIs
🔀
if / for
Decisions and loops — indentation matters
🔧
Functions
def name(args): ... return value
📦
Imports
import pandas as pd — the famous one
✍️
The conventions
np, pd, plt — use these aliases
Now practise what you learned
1
Open the practice lab
60–90 minutes of exercises. Hints when you’re stuck. Full solutions. The lab matters more than the video.
2
Type every line yourself
Don’t copy-paste. Typing every character builds the muscle memory. Even typos teach.
3
Use your own data
Open a CSV you actually have — your phone bill, your expenses, your college marks. Load it, explore it, summarise it.
4
Get the rhythm of Shift+Enter
Run, see output, edit, run again. The fast-iteration loop is what makes Jupyter productive.
💡 Honest truth: the lab is where the learning happens. Skip the lab and this lesson stays a one-time watch. Do the lab and it becomes a skill you own.
Great work — Lesson 1.1 complete!
You can now navigate Jupyter, use Python’s basic types, build lists and dictionaries, write functions and loops, and import libraries. That’s the foundation. In Lesson 1.2 we go deeper — NumPy, arrays, and vectorised speed.
🎓
Synkoc Instructor
See you in Lesson 1.2 — keep practising!
Up next:
NumPy & Arrays
0:00 / 30:00
🔊