Data Types vs Data Shapes
Data Types vs Data Shapes
This page was filed from a query that asked: what are the different kinds of data types?
Short answer
The wiki uses a few overlapping lenses:
- column/dataframe dtypes like integer, float, string, boolean, date, and datetime dtypes
- database-style column types as part of rows/columns/type thinking Database Mental Models
- Python runtime data shapes like string, list, dict, and object Python Data Shapes
- JSON value forms like strings, primitive values, lists, and nested objects json
The key distinction
1. Dtypes = what a column is made of
In structured data tools, a dtype is the type assigned to a column, and it determines which operations are valid. Typical examples are integers, floats, strings, booleans, dates, and datetimes. dtypes
2. Data shapes = what a value or structure looks like in code
In Python, the course also talks about shape: whether the thing in front of you is a string, list, dict, or object. This is especially useful when parsing nested or heterogeneous data. Python Data Shapes
3. JSON forms = how data arrives over APIs
API payloads often arrive as JSON, which is then parsed into Python structures. The wiki describes JSON as strings, primitive values, lists, and nested objects. json
Practical takeaway
If you are working with a dataframe, ask: what is this column’s dtype? dtypes If you are working with Python values directly, ask: what shape is this data at runtime? Python Data Shapes If you are reading an API response, ask: what JSON structure did I get back? json