Skip to Content

Data Types & Structures


πŸ”€ Data Types – The β€œkind” of data you're working with

These are the basic building blocks of data.

πŸ“¦ Common Data Types:

Type Example Description
Integer 5, -20, 0 Whole numbers
Float 3.14, -0.99 Decimal numbers
Boolean True, False Logical values
String "hello", '123' Text data
Date/Time 2025-04-27, 10:30 Temporal data

πŸ—‚οΈ Data Structures – How you organize and store that data

They let you store, access, and manipulate data efficiently.

πŸ”§ Common Data Structures:

Structure Description Example (Python-style)
List / Array Ordered collection, can hold mixed types [1, 2, 3] or ['a', 'b', 'c']
Tuple Like a list but immutable (can’t be changed) (3, 'x')
Dictionary / Hash Map Key-value pairs {"name": "Alice", "age": 25}
Set Unordered, no duplicates {1, 2, 3}
DataFrame 2D labeled table (used in pandas) Like a spreadsheet of rows & columns
Matrix 2D array of numbers [[1, 2], [3, 4]]
Tree / Graph Hierarchical or network structures (advanced) Used in file systems, social networks

🧠 How They Work Together:

  • Data types live inside data structures.
  • Example: A list of integers β†’ [10, 20, 30]
  • In a DataFrame, each column has a specific data type.

πŸ“Š Real-World Example:

In a student dataset:

{
  "name": "Alex",             # String
  "age": 21,                  # Integer
  "grades": [88, 92, 75],     # List of Integers
  "passed": True              # Boolean
}

Would you like a visual chart or code example showing these in action?