⚡0 XP🔥0

Types of Data, Data Sources and Data Quality

Lesson 2 of 5 ⏱ 5 min read ❓ 5-question quiz ▶ Runs Python

Structured vs unstructured data, numerical and categorical variables, levels of measurement, where business data comes from, file formats, and the common data quality problems you must fix.

Structured, semi-structured and unstructured data#

Type Description Examples
Structured Fixed rows and columns, every column has a type Excel sheets, SQL tables, CSV files
Semi-structured Has labels/tags but a flexible shape JSON from APIs, XML, log files
Unstructured No predefined structure Reviews, emails, PDFs, images, call recordings

Data analysts work mostly with structured data, and often convert semi-structured data (like JSON) into tables.

{"order_id": "VM-2025-00812", "city": "Indore", "items": [{"product": "Study Table", "qty": 1}]}

Types of variables#

Every column in a table is a variable. Knowing its type tells you which calculations and charts make sense.

Type Sub-type Meaning Examples Typical summary
Numerical (quantitative) Discrete Countable whole numbers quantity, number of orders sum, mean, count
Continuous Any value in a range sales amount, weight, time mean, median, std
Categorical (qualitative) Nominal Categories, no order region, payment mode, product count, mode, % share
Ordinal Categories with an order rating (Poor→Excellent), size (S/M/L) median, mode
हिंदी में समझें

Data के columns दो बड़े प्रकार के होते हैं:

  • Numerical (संख्यात्मक) - जिनका जोड़-औसत निकाला जा सकता है। जैसे quantity (गिनती वाली - discrete), sales amount (दशमलव वाली - continuous)।
  • Categorical (श्रेणी वाले) - नाम या समूह। जैसे region, payment mode (nominal - कोई क्रम नहीं), या rating Poor/Good/Excellent (ordinal - क्रम है)।

यह पहचानना ज़रूरी है, क्योंकि "region का औसत" निकालना बेमतलब है - region पर हम गिनती (count) या हिस्सा (%) निकालते हैं।

Common Mistake

Numbers aren't always numerical! PIN codes, mobile numbers, employee IDs and invoice numbers are categorical - adding or averaging them is meaningless. Store them as text so Excel doesn't remove leading zeros.

The Vindhya Mart dataset#

Our practice dataset has 1,500 orders and 17 columns:

Column Type Example
order_id categorical (ID) VM-2025-00812
order_date date 2025-10-21
region, state, city nominal Central, Madhya Pradesh, Indore
customer_id categorical (ID) CUS-0153
segment nominal Consumer / Corporate / Small Business
category, sub_category, product nominal Technology, Phones, Redmi Note Smartphone
quantity discrete 2
unit_price, sales, cost, profit continuous 14999, 26998.2 ...
discount continuous (0-0.3) 0.10
payment_mode nominal UPI
Download the practice files

Have a first look with Python (just press Run - you'll learn this code in Module 5):

▶ Try it Yourselfsales.csvPython
Ctrl + Enter to run

Where does business data come from?#

Source Examples How analysts access it
Transactional databases Billing/POS, ERP (Tally, SAP), CRM SQL queries
Spreadsheets Targets, manual registers, MIS reports Excel, Power Query
Web & app analytics Google Analytics, app events Exports, APIs
APIs Payment gateways, courier tracking, government data Python requests
Surveys & forms Google Forms, feedback CSV export
Cloud storage / warehouses AWS S3, Azure Data Lake, BigQuery, Snowflake SQL, connectors
Public datasets Kaggle, data.gov.in, World Bank Download CSV

Primary vs secondary data#

  • Primary - collected by you for this purpose (your survey).
  • Secondary - collected by someone else (company database, Kaggle, government reports).

Common file formats#

Format Notes
.csv Plain text, universal, no formatting, one table
.xlsx Excel workbook - many sheets, formulas, formatting
.json Nested data from APIs and web apps
.parquet Compressed, fast columnar format used in big data and cloud
.sql / .db Database scripts and files

Data quality - the problems you will fix#

"Garbage in, garbage out": wrong data gives wrong conclusions, however good your charts are.

Problem Example in sales_raw.csv Fix (you'll learn)
Missing values blank region or quantity fill, look up, or exclude
Duplicates the same order row twice remove duplicates
Inconsistent text "INDORE", " indore", "Indore" TRIM / PROPER / standardise
Different names, same thing "Bangalore" vs "Bengaluru" mapping table / replace
Mixed formats dates as 21/10/2025, 21-10-2025, 21 Oct 2025 convert to a real date type
Numbers stored as text "Rs. 26,998.20" remove symbols, convert to number
Outliers / errors quantity = 5000 for one chair investigate, correct or flag
▶ Try it Yourselfsales_raw.csvPython
Ctrl + Enter to run
हिंदी में समझें

Data quality यानी data कितना सही और भरोसेमंद है। गंदे data पर बनी report गलत फ़ैसले करवा सकती है।

सबसे आम समस्याएँ: खाली values, दोहराई गई rows (duplicates), एक ही शहर के अलग-अलग नाम ("Bangalore" / "Bengaluru"), अलग-अलग तरह से लिखी तारीख़ें, और "Rs. 2,500" जैसी text वाली रकम।

इन्हें ठीक करना ही data cleaning है - आप इसे Excel (Module 2) और Python (Module 5) दोनों में सीखेंगे।

Summary#

  • Data can be structured, semi-structured or unstructured; analysts mostly use structured tables.
  • Variables are numerical (discrete/continuous) or categorical (nominal/ordinal) - the type decides the right summary.
  • IDs, PIN codes and phone numbers are categorical, not numbers.
  • Business data comes from databases, spreadsheets, APIs, surveys, cloud and public datasets.
  • Always check quality: missing values, duplicates, inconsistent text, mixed formats, numbers-as-text, outliers.

Quick Quiz

Q1.

"Payment mode" (UPI, Card, Cash) is what type of variable?

Q2.

"Customer rating" (Poor, Average, Good, Excellent) is...

Q3.

Which is unstructured data?

Q4.

The same city appears as "Bengaluru", "Bangalore" and "BENGALURU". Which quality problem is this?

Q5.

Which file format is plain text with values separated by commas?