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.4.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for kn_flatten_json-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fe0b72b51e43c94a3d0ca8110c56be5cd9c939d897cbfd8cea8c79d228a0fd7 |
|
MD5 | d219c505e1f7b9035e8e3eaad8ff8f91 |
|
BLAKE2b-256 | e39209a87d6e955713159cd65a972bcae734f478d159f9064914cc7473220f31 |