Skip to main content
badge
logo
go from data to knowledge

ElixirDx

A collaborative notebook platform that enables teams to use and visualize data, together.

Requirements

Python 3.8+

Installation

pip install dx

Then import the package:

import dx

Usage

The dx library currently enables DEX media type visualization of pandas DataFrame and Series objects, as well as numpy ndarray objects. This can be handled in two ways:

  • explicit dx.display() calls
  • setting the display_mode to update the IPython display formatter for a session

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

    df = dx.random_dataframe()
    df.to_csv("dx_docs_sample.csv", index=False)
    
    dx.display("dx_docs_sample.csv")
    

With dx.set_display_mode()

Using either "simple" or "enhanced" display modes will allow 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.

Details

This will adjust pandas options to:

  • increasing the number of rows displayed to 50000 from pandas default of 60
  • increasing the number of columns displayed to 50 from pandas default of 20
  • enabling html.table_schema (False by default in pandas)

This will also handle some basic column cleaning and generate a schema for the DataFrame using pandas.io.json.build_table_schema. Depending on the display mode, the data will be transformed into either a list of dictionaries or list of lists of columnar values.

  • "simple" - list of dictionaries
  • "enhanced" - list of lists

NOTE: Unlike dx.display(), this only affects pandas DataFrames (or any types set in settings.RENDERABLE_OBJECTS); it does not affect the display of .csv/.json file data, or dict/list outputs

  • dx.set_display_mode("simple")

    import dx
    import numpy as np
    import pandas as pd
    
    # enable DEX display outputs from now on
    dx.set_display_mode("simple")
    
    df = pd.read_csv("dx_docs_sample.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
    

If, at any point, you want to go back to the default display formatting (vanilla pandas output), use the "plain" display mode. This will revert the IPython display format update to its original state and put the pandas options back to their default values.

  • dx.set_display_mode("plain")
    # revert to original pandas display outputs from now on
    dx.set_display_mode("plain")
    
    df = pd.read_csv("dx_docs_sample.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
    

Generating Sample Data

Documentation coming soon!

Contributing

See CONTRIBUTING.md.

Code of Conduct

We follow the ElixirNote code of conduct.

LICENSE

See LICENSE.md.

Metadata

Release files for elixir-dx 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elixir-dx 1.0.0
File Size Uploaded
elixir-dx-1.0.0.tar.gz 49.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for elixir-dx 1.0.0
File Interpreter ABI Platform
elixir_dx-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 114.1 kB

Release files / elixir-dx-1.0.0.tar.gz

Download URL elixir-dx-1.0.0.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b813cddd496df57cced9458df4692c1dc725d2b8f193b377e4d2482bc73ee934
BLAKE2b-256 checksum
How to use checksums
3c804696908e42c6d4dd35cf9fbbaabc83dd5ae39977485d369849cd2b088dff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / elixir_dx-1.0.0-py3-none-any.whl

Download URL elixir_dx-1.0.0-py3-none-any.whl
Size 64.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67f314c417d0f974381ab10a33bbf035392c3fb5561dc39ca2ccf7073f2f1df6
BLAKE2b-256 checksum
How to use checksums
665edcb8783855dc1e738464fa133f181bda8fa0e19b8fab03e8f622211c71cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page