https://github.com/ccoffrin/py-json-examples
Examples of working with JSON data in Python
https://github.com/ccoffrin/py-json-examples
Last synced: about 1 year ago
JSON representation
Examples of working with JSON data in Python
- Host: GitHub
- URL: https://github.com/ccoffrin/py-json-examples
- Owner: ccoffrin
- License: mit
- Created: 2021-11-18T20:44:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-22T17:56:27.000Z (over 4 years ago)
- Last Synced: 2025-01-22T03:33:08.339Z (over 1 year ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# py-json-examples
Examples of working with JSON data in Python
## Outline
- Reading CSV data in python (see `csv-read.py`)
- types of data (string / float / int / boolean)
- missing data
- column names
- better solution? if data is truely tabular use "dataframes" (see pandas)
- but what if the data is not tabular?
- What is JSON? (see `data/json_00.json`)
- data types, string / float / int / boolean, null
- resursive design
- very easy to parse
- Reading JSON data in pyhton (see `json-read.py`)
- python data structure built automatically
- data types encoded automatically
- Data encoding ideas (see `json-encoding.py`)
- array of arrays (row-first, csv like) `json_table_01.json`
- dict of arrays (column-first, dataframe like) `json_table_02.json`
- array of dicts (map, object like) `json_table_03.json`
- CSV to JSON
- pick a JSON encoding
- perform data structure manipulations in python into a dict
- write JSON
- basic solution `csv-to-json-01.py`
- more advanced solution `csv-to-json-02.py`