kn_flatten_json
Project description
Project description
Kpt-flatten-json pypi package helps to flatten a dataframe containing complex datatypes like arrays and structures.
Installation
$ [sudo] pip install kpt_flatten_json
Function
kpt_flatten_json: Returns a flattened dataframe
Usage/Examples
from kpt_flatten_json import *
flatdf= kpt_flatten_json(complexdf)
Complex Dataframe
batters | id | name | ppu | topping | type |
---|---|---|---|---|---|
{[{1001, Regular}... | 0001 | Cake | 0.55 | [{5001, None}, {5... | donut |
Flattened Dataframe
id | name | ppu | type | topping_id | topping_type | batters_batter_id | batters_batter_type |
---|---|---|---|---|---|---|---|
0001 | Cake | 0.55 | donut | 5001 | None | 1001 | Regular |
0001 | Cake | 0.55 | donut | 5001 | None | 1002 | Chocolate |
0001 | Cake | 0.55 | donut | 5001 | None | 1003 | Blueberry |
0001 | Cake | 0.55 | donut | 5001 | None | 1004 | Devil's Food |
0001 | Cake | 0.55 | donut | 5002 | Glazed | 1001 | Regular |
0001 | Cake | 0.55 | donut | 5002 | Glazed | 1002 | Chocolate |
0001 | Cake | 0.55 | donut | 5002 | Glazed | 1003 | Blueberry |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kn_flatten_json-0.0.5.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for kn_flatten_json-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cd566fffec29988f467e6a43690de829080967012315c527bda1992ebc28bdf |
|
MD5 | 387ddae0bdfd208623ae93ebb847fb2a |
|
BLAKE2b-256 | 829ef6ca8d84c3ce178bdbf1459a6205770cbee465cc07aab24b675e4dd3e0b9 |