Skip to main content

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


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)

Uploaded Source

Built Distribution

kn_flatten_json-0.0.5-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page