π€ 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?