Free tutorials & notes in Hindi & English · Clean code examples 🧰 Free PDF & Image Tools →
🐍 Week 1 – Python for Data Science  ·  Day 02

Day 2: Setup: Python, Jupyter & Google Colab

⏱ 60 min📶 Beginner🎯 100% self-study
Day 2 / 60

✅ Today you will learn

  • Choose your setup: Google Colab, Anaconda or plain Python
  • Install pandas, NumPy, Matplotlib, Seaborn, scikit-learn
  • Use Jupyter cells, Markdown and shortcuts
  • Load the course datasets
  • Run your first data notebook

🏢 In the real world

On day one at a data job you will get a laptop, access to a Jupyter or Colab workspace and a folder of CSV files. Being comfortable with notebooks is the very first skill every analyst uses daily.

Choose your setup

Google Colab (easiest)

  • Runs in the browser – nothing to install
  • Free GPU for deep learning
  • Files saved in Google Drive
  • Needs internet

Anaconda / Jupyter on your PC

  • Works offline
  • Full control of files and versions
  • Same as most company laptops
  • About 3 GB download

Beginners: start with Colab today and install Anaconda later. Both run exactly the same code.

Option 1 – Google Colab in 3 steps

  1. 1Open colab.research.google.com and sign in with your Gmail
  2. 2Click New notebook
  3. 3Type print("Hello Data") in the cell and press Shift + Enter
Your first Colab cell
Colab cell – upload a CSV from your computer
from google.colab import files
uploaded = files.upload()          # choose sales_data.csv
import pandas as pd
sales = pd.read_csv("sales_data.csv")
sales.head()

Option 2 – Anaconda or plain Python

Anaconda (anaconda.com/download) installs Python, Jupyter and the main data libraries in one go. Or install Python 3 from python.org and run:

Command Prompt / Terminal
pip install jupyter pandas numpy matplotlib seaborn scikit-learn scipy plotly openpyxl
jupyter notebook          # opens Jupyter in your browser
💡 Virtual environment (good habit)

Companies keep each project in its own environment: python -m venv ds-env, then activate it (ds-env\Scripts\activate on Windows, source ds-env/bin/activate on Mac/Linux) and pip install inside it.

Check your installation

Python
import sys, numpy, pandas, matplotlib, seaborn, sklearn
print("Python      :", sys.version.split()[0])
for lib in [numpy, pandas, matplotlib, seaborn, sklearn]:
    print(f"{lib.__name__:12}:", lib.__version__)
Python : 3.13.16 numpy : 2.5.3 pandas : 2.3.3 matplotlib : 3.11.2 seaborn : 0.13.2 sklearn : 1.9.1

Your version numbers may be a little different – that is fine. Any recent version runs this course.

Jupyter notebook basics

▶️
Code cellRuns Python. The last line is shown automatically.
📝
Markdown cellNotes, headings, bullet points – your analysis story.
🔁
KernelThe Python engine. “Restart & Run All” checks that the notebook works from top to bottom.
Three things every notebook has
ShortcutAction
Shift + EnterRun cell and go to next
Esc then A / BNew cell above / below
Esc then M / YChange to Markdown / Code
Esc then D DDelete cell
TabAuto-complete names
Shift + TabShow help of a function

The course datasets

All 60 days use the same set of realistic Indian datasets. Download them once from the course kit and keep them in the same folder as your notebooks.

FileRowsUsed for
sales_data.csv2,000Retail sales of an online store – pandas, EDA, charts
sales_dirty.csv312Data cleaning practice
students_performance.csv500Statistics, charts, mini project
house_prices.csv800Regression (price prediction)
loan_applications.csv1,200Classification (loan approval)
telecom_churn.csv3,000Major project – churn prediction
mall_customers.csv200Clustering (customer segments)
delhi_weather.csv1,096Time series & forecasting
product_reviews.csv600NLP – sentiment model
ab_test.csv4,000A/B testing
employees.csv, departments.csv30 / 5SQL joins and window functions

Your first data notebook

Python
import pandas as pd
students = pd.read_csv("students_performance.csv")
print("Rows and columns:", students.shape)
print(students.head())
Rows and columns: (500, 13) student_id gender school_type study_hours attendance parent_education tuition internet maths science english average result 0 S1001 Male Government 3.0 79.0 Graduate Yes No 65.0 76.0 71.0 70.7 Pass 1 S1002 Male Private 3.4 67.0 School Yes Yes 50.0 54.0 77.0 60.3 Pass 2 S1003 Male Private 2.6 72.0 Graduate No Yes 50.0 69.0 71.0 63.3 Pass 3 S1004 Male Private 1.8 96.0 Graduate No Yes 68.0 70.0 66.0 68.0 Pass 4 S1005 Male Government 2.4 90.0 Post-Graduate No Yes 67.0 77.0 66.0 70.0 Pass
Python
import pandas as pd
students = pd.read_csv("students_performance.csv")
print("Average maths marks :", round(students["maths"].mean(), 1))
print("Pass percentage     :", round((students["result"] == "Pass").mean() * 100, 1), "%")
print("Top study hours     :", students["study_hours"].max())
Average maths marks : 64.9 Pass percentage : 99.8 % Top study hours : 6.6
📁 FileNotFoundError?

It means Python cannot see the CSV. Keep the file in the same folder as the notebook, or give the full path like pd.read_csv("C:/data/sales_data.csv"). In Colab, upload the file first (see above).

🏅 Job skills unlocked today

✔ Use Google Colab✔ Install data libraries with pip✔ Work with Jupyter cells and shortcuts✔ Load a CSV into pandas

Practice tasks

🏋️ Practice – do it yourself

Task 1: Create a new notebook named day02_practice.ipynb. Add a Markdown heading “My first analysis” and one code cell that prints your name.
Task 2: Load house_prices.csv and print its shape and the first 3 rows.
Show solution
Python
import pandas as pd
houses = pd.read_csv("house_prices.csv")
print(houses.shape)
print(houses.head(3))
(800, 9) city area_sqft bedrooms bathrooms age_years metro_km furnishing parking price_lakh 0 Pune 1210 2 2 18 7.0 Furnished No 55.07 1 Bengaluru 850 2 2 15 4.6 Semi-Furnished No 48.22 2 Hyderabad 530 1 1 8 2.1 Semi-Furnished Yes 26.64
Task 3: Find the most expensive house price in house_prices.csv.
Show solution
Python
import pandas as pd
houses = pd.read_csv("house_prices.csv")
print("Highest price (lakh):", houses["price_lakh"].max())
Highest price (lakh): 199.97

Quick quiz

🧠 Quick Quiz – test yourself

1. Which shortcut runs a Jupyter cell?
Shift + Enter runs the cell and moves to the next one.
2. What is the main advantage of Google Colab?
Colab runs in the browser and gives free compute, including GPUs.
3. Which command installs pandas?
pip is Python's package installer.
4. A Markdown cell is used for…
Markdown cells hold text that explains your analysis.
5. You get FileNotFoundError on read_csv. What is the most likely reason?
Keep the file next to the notebook or give the full path.

Interview corner

💼 Interview Corner

Why do data scientists use notebooks?

Notebooks mix code, output, charts and explanations in one document, which makes exploration fast and the analysis easy to share and review. For production code, the logic is later moved into .py files.

What is a virtual environment and why use it?

An isolated Python installation per project, so library versions of one project do not break another. Created with venv or conda, and listed in requirements.txt.

Summary

  • Colab = zero install; Anaconda/Jupyter = offline and full control.
  • Install libraries with pip install …; check versions with __version__.
  • Shift + Enter runs a cell; Markdown cells tell the story.
  • Keep the course CSV files next to your notebooks.
➡️ Next

Day 3: Python basics for data – variables, data types, operators and f-strings with real numbers.

Frequently Asked Questions

Should I use Jupyter Notebook or JupyterLab?
Either. JupyterLab is the newer interface with tabs and a file browser; the notebooks are the same .ipynb files.
Can I use VS Code?
Yes. Install the Python and Jupyter extensions in VS Code and open any .ipynb file.
Where do I get the datasets?
From the Data Science course kit on the downloads page (free account needed). It contains all CSV files and the code of every day.
← Data Science (60 Days)
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

Next topicDay 3: Python Basics: Variables, Types, Operators Your progress: 2 / 60 (3%) · Lesson 3 / 60 Continue →

How was this lesson?

Your feedback helps us make the content better.

Write a review or suggestion (optional)

After approval, your name and city may appear publicly with your review. Please do not write your email or phone number.

▶ CodingEasily on YouTube

Learn with video lessons in easy Hindi

Featured video: RDBMS Part 3 – Class XI Commerce IT

▶ Subscribe – it’s free