🔵 Data Science · Lesson 34
Jupyter Notebook and Google Colab
What is Jupyter Notebook and Google Colab?
Jupyter Notebook and Google Colab means jupyter Notebook and Google Colab are popular tools for writing Python code, notes, outputs and charts together.
In real programs, this topic helps in writing code with notes. Learn the idea first, then type the program yourself and compare the output.
💡 At a Glance
| Point | Details |
|---|---|
| Course Area | Data Science Tools and concepts used to analyse, clean and present data. |
| Main Use | writing code with notes |
| Example File | jupyter-colab.py |
| Practice Focus | Run, change values, and explain the output line by line. |
Why should you learn this?
- It is useful for writing code with notes.
- It connects with showing charts and outputs.
- It improves your ability to read, write and debug Python programs.
Important Terms
These terms are used directly in this lesson. Understand them before memorising the code.
| Term | Meaning |
|---|---|
| notebook | Interactive document that mixes code, output and notes. |
| cell | Single executable block in a notebook. |
| markdown | Simple text formatting used for notes in notebooks. |
| Colab | Cloud-based notebook service useful for Python and ML practice. |
| data science workflow | data science workflow is an important term in this topic. |
Syntax / Basic Pattern
The simple pattern is: prepare data, apply the concept, then show the result.
Basic Pattern
import pandas as pd
data = {"Name": ["Aarav", "Riya"], "Marks": [85, 92]}
df = pd.DataFrame(data)
dfComplete Example Program
Python – jupyter-colab.py
# In a notebook cell
import pandas as pd
data = {"Name": ["Aarav", "Riya"], "Marks": [85, 92]}
df = pd.DataFrame(data)
dfExpected Output
Name Marks
0 Aarav 85
1 Riya 92
Program Explanation
import pandas as pdimports ready-made features from a module/library.data = {"Name": ["Aarav", "Riya"], "Marks": [85, 92]}stores a value in data.df = pd.DataFrame(data)stores a value in df.dfperforms the next step of the program logic.
Where will you use it?
- Writing code with notes.
- Showing charts and outputs.
- Sharing notebooks.
Common Mistakes
- Analysing data before checking missing values, duplicates and data types.
- Changing original data without keeping a clean copy.
- Creating charts without title, labels or explanation.
Practice Tasks
- Type the program in
jupyter-colab.pyand run it. - Change input values or sample data and observe the new output.
- Create one example related to writing code with notes.
- Write 5 lines explaining the logic in your own words.
Summary
Jupyter Notebook and Google Colab is not a theory-only topic. You should be able to explain the meaning, write the example, run it successfully, and use it in a small practical program.