Skip to main content

Python wrapper for Data Explorer

Project description

A Pythonic Data Explorer.

Install

For Python 3.8+:

pip install dx>=1.0.3

Usage

The dx library currently enables DEX media type visualization of pandas DataFrames in two ways:

  • individual calls to dx.display()
  • updating the current IPython display formatter for a session

Importing

import dx

With dx.display()

dx.display() will display a single dataset using the DEX media type. It currently supports:

  • pandas DataFrame objects

    import pandas as pd
    import random
    
    df = pd.DataFrame({
        'random_ints': [random.randint(0, 100) for _ in range(500)],
        'random_floats': [random.random() for _ in range(500)],
    })
    dx.display(df)
    

  • tabular data as dict or list types

    dx.display([
      [1, 5, 10, 20, 500],
      [1, 2, 3, 4, 5],
      [0, 0, 0, 0, 1]
    ])
    

  • .csv or .json filepaths

With dx.register() and dx.deregister()

dx will update the current IPython display formatters to allow DEX media type visualization of pandas DataFrame objects for an entire notebook / kernel session instead of the default DataFrame display output.

Note: this only affects pandas DataFrames; it does not affect the display of .csv/.json file data, or dict/list outputs

  • dx.register()

    import pandas as pd
    
    # enable DEX display outputs from now on
    dx.register()
    
    df = pd.read_csv("examples/sample_data.csv")
    df
    
    df2 = pd.DataFrame(
        [
            [1, 5, 10, 20, 500],
            [1, 2, 3, np.nan, 5],
            [0, 0, 0, np.nan, 1]
        ],
        columns=['a', 'b', 'c', 'd', 'e']
    )
    df2
    

  • dx.deregister()

    df2 = pd.DataFrame(
        [
            [1, 5, 10, 20, 500],
            [1, 2, 3, np.nan, 5],
            [0, 0, 0, np.nan, 1]
        ],
        columns=['a', 'b', 'c', 'd', 'e']
    )
    df2
    
    dx.deregister()
    df2
    

Develop

git clone https://github.com/noteable-io/dx
cd ./dx
pip install -e .

Code of Conduct

We follow the noteable.io code of conduct.

LICENSE

See LICENSE.md.

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

dx-1.1.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dx-1.1.1-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file dx-1.1.1.tar.gz.

File metadata

  • Download URL: dx-1.1.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.8.10 Linux/5.10.60.1-microsoft-standard-WSL2

File hashes

Hashes for dx-1.1.1.tar.gz
Algorithm Hash digest
SHA256 15c7064bc3f4db7d626d44ba9fe2e02d70b125966f16ae751203cbcb09dc84c5
MD5 93e6ce0485c9ad5279542b1bb93451cb
BLAKE2b-256 1e651a64373647d86ec5d13076c24ad2b42a9f1e051831d1a757babc93e1c586

See more details on using hashes here.

File details

Details for the file dx-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: dx-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.8.10 Linux/5.10.60.1-microsoft-standard-WSL2

File hashes

Hashes for dx-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 368ca603efef204873c6c63ead7884941fb95a3eb64afedc99c43db22a027764
MD5 8ee92eca7f084f126d04fdc05d1d56c7
BLAKE2b-256 9ea12cd195d392ff9cf8289eb7a2e1ecb3859d1742e3fb93793539c86ac2aa14

See more details on using hashes here.

Supported by

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