Skip to content
VJ Classes

One place to learn science, commerce, arts, computers and life skills

Understanding Data and the Workflow

What Is Data Science? The Question and the Workflow

Key points

  • Data science turns data into decisions, and it starts with a clear question, not with a tool.
  • The workflow is ask, collect, clean, explore, model, then communicate and act, and real projects loop back.
  • Data analysis describes what happened. Data science also explains and predicts. Machine learning is one toolbox inside it.
  • Good work needs three skills together: programming, statistics and knowledge of the subject.
  • A result matters only if it changes a decision, so always check whether it worked.

Types of Data and How to Collect It

Key points

  • Rows are observations and columns are variables. A tidy table has one variable per column and one observation per row.
  • Numerical data is discrete or continuous. Categorical data is nominal or ordinal. The type decides which summaries are valid.
  • Identifiers such as PIN codes and phone numbers are labels, not quantities.
  • Data can be structured (CSV, database tables), semi-structured (JSON) or unstructured (text, images). Values read from a file often arrive as text.
  • Primary data is collected by you, secondary data by others. Judge any source on relevance, accuracy, completeness, recency, representativeness and permission.

Working with Data in Python

From Spreadsheets to Python with pandas

Key points

  • pandas works with DataFrames (tables) and Series (single columns). Code is a repeatable record of what you did, unlike clicking in a spreadsheet.
  • After reading a file with read_csv, take a first look with head(), shape, dtypes and describe().
  • Select columns with df["col"] or df[["a", "b"]]. Select rows by label with loc and by position with iloc.
  • Filter with a condition inside square brackets. Join conditions with &, | and ~, each in parentheses.
  • groupby splits rows into groups, applies a calculation to each, and combines the results. Always check one result by hand.

Cleaning Data: Making Messy Data Trustworthy

Key points

  • Real data has missing values, duplicates, inconsistent text, wrong types, impossible values and mixed formats. Look for them before analysing.
  • Work on a copy of the raw data and write every fix as code, so the cleaning can be checked and repeated.
  • Missing values can be dropped, filled or left missing. Choose per column and never invent values for the thing you are studying.
  • An outlier is not always an error. Use a rule such as the IQR rule to find it, then investigate before removing it.
  • After cleaning, check the data again and record what you changed.

Exploring Data with Charts in matplotlib

Key points

  • Charts reveal patterns that summary numbers hide, so always plot your data before modelling it.
  • Choose the chart by the question: line for change over time, bar for categories, histogram for the spread of one column, scatter for two columns, box plot for groups.
  • In matplotlib, create a figure and axes with plt.subplots(), draw, label, then call savefig and plt.show().
  • Label axes with units, start bars at zero and use colour sparingly. A cut axis can make a small difference look huge.
  • A chart can show that something happened, but not why. Explaining a pattern needs domain knowledge.

Statistics, Machine Learning and Responsible Practice

The Statistics Data Science Needs

Key points

  • Extreme values pull the mean but not the median, so report the median for skewed data.
  • The standard deviation measures spread. pandas divides by n − 1 (sample SD); NumPy divides by n unless told otherwise.
  • In a normal distribution, about 68%, 95% and 99.7% of values lie within 1, 2 and 3 SDs of the mean.
  • Correlation r runs from −1 to +1 and detects only straight-line links. It does not prove cause, because a confounder may drive both columns.
  • A random sample’s error shrinks as σ ÷ √n. A biased sample stays wrong however large it is.

Your First Machine Learning Models

Key points

  • Supervised learning learns from examples with known answers. A numerical target gives regression, and a category gives classification.
  • scikit-learn follows one routine for every model: create, fit on training data, predict, then evaluate on test data.
  • Always hold back a test set. A model must be judged on data it has not seen.
  • For regression, compare MAE and R² with a simple baseline. For classification, read the confusion matrix, not only the accuracy.
  • A big gap between training and test scores signals overfitting. Avoid data leakage by keeping the answer out of the features.

Ethics, Privacy and Building Your Portfolio

Key points

  • Models copy the biases in their data. Check performance for each group, beware of proxy columns, and be honest about limits.
  • Personal data needs consent, a lawful purpose and security. India’s Digital Personal Data Protection Act, 2023 is built around these ideas.
  • Collect only what you need, remove direct identifiers early, and generalise the rest. Exact age plus PIN code can identify a person even without a name.
  • A portfolio of three honest, well-explained projects shows your skills better than certificates alone.
  • Keep learning: SQL, deeper statistics, more models, and real projects from your own field.

Important terms

  • accurate
  • allowed
  • APIs
  • applies
  • Ask
  • Bias
  • Categorical
  • Clean
  • Collect
  • column
  • combines
  • Communicate and act
  • complete
  • continuous
  • CSV
  • Data
  • Data cleaning
  • Data science
  • DataFrame
  • Dates and times
  • discrete
  • Domain knowledge
  • Drop
  • Explore
  • feature
  • Fill
  • Filtering
  • Identifiers
  • Information
  • JSON
  • Knowledge
  • logs and sensors
  • Model
  • NaN
  • nominal
  • Numerical
  • observation
  • ordinal
  • pandas
  • population
  • predict
  • Primary data
  • Programming
  • recent
  • relevant
  • representative
  • row
  • sample
  • Secondary data
  • Selecting
  • Semi-structured
  • Series
  • splits
  • Statistics
  • Structured
  • surveys and forms
  • tidy
  • Unstructured
  • variable
  • web scraping
Enrol to read the full lessons. This page is a summary. The lessons explain every point with examples, and enrolling also gives you the full notes PDF and your progress. See the course