kpt_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.3.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for kn_flatten_json-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4c67547151079f5117d096fd669c8bf040d0180a98642f3b5921caaf02b67df |
|
MD5 | 99898835e207219ef5d48d1fb441a341 |
|
BLAKE2b-256 | fca750f158c0d1e2dc2590b45a1c5bb494822bad12d51e4ad7f747904ae026a7 |