Chapter 3 of 30

Keep learning and build your Data Science skills.

10%
Chapter 3

Python for Data Science

Learn how Python is used for data analysis, visualization, and modeling.

Theory

Python is one of the most widely used programming languages for Data Science. Important Python libraries include: • NumPy • Pandas • Matplotlib • Seaborn • Scikit-learn Python is popular because it has a large ecosystem of libraries and is relatively easy to use for data analysis and automation.

Example

import pandas as pd

data = {
    "Age": [20, 25, 30],
    "Salary": [25000, 40000, 60000]
}

df = pd.DataFrame(data)

print(df)
print(df["Salary"].mean())

Output

The DataFrame is displayed and the average salary is calculated.

Practice

Create a Pandas DataFrame containing at least three columns.

Interview Questions

1

Why is Python popular in Data Science?

2

What is Pandas?

3

What is NumPy?

4

Which Python libraries are commonly used in Data Science?

Quick Quiz

Which option best describes this chapter?

A.Python
B.HTML
C.CSS
D.SQL Server