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.7.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for kn_flatten_json-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e0f613b925ced0437c380634f710cab6df71787fd0d0294542b2a6aa9e2079 |
|
MD5 | 1667ea96a8eae57dd9ba3d402833789f |
|
BLAKE2b-256 | 0fe290135732b801ad8d26659d15e2175fffdc242e9f08c9fb4152be7620659f |