Data Science Tutorial
Data science is the skill of collecting data, cleaning it, exploring it and using it to answer questions and make predictions.
Shops want to know which products sell best. Hospitals want to spot patients at risk. Banks want to catch fraud. All of them need people who can work with data, and Python is the most popular language for the job.
This tutorial uses Python and the pandas library. You should know basic Python first: variables, lists, dictionaries, loops and functions.
What You Will Learn
- What data science is and the steps of a data project
- pandas Series and DataFrames
- Loading CSV files and exploring a dataset
- Cleaning data: missing values, duplicates and wrong types
- Filtering, sorting and grouping to answer questions
- Making charts with matplotlib
- Basic statistics and your first machine learning model with scikit-learn
A First Example
This code finds the students who scored more than 75:
Example
import pandas as pd
df = pd.DataFrame({
"student": ["Ali", "Ayesha", "Bilal", "Sana", "Hamza"],
"marks": [72, 85, 90, 64, 78],
})
print(df[df["marks"] > 75])student marks 1 Ayesha 85 2 Bilal 90 4 Hamza 78
Exercises and Quiz
Lessons end with a short exercise, and the last lesson has a quiz on the whole tutorial.
Exercise
Which Python library is most used for working with tables of data?
What to Learn Next
If you are new to spreadsheets and data, the Excel tutorial is a gentle start. To store data in databases, learn SQL, and to deploy data projects in the cloud, see AWS.
Want to learn with a teacher? The Workownix Python Programming course takes you from Python basics to working with real data, online or at our institute in Orangi Town, Karachi.
