Skip to main content

ssmode

Installing & Importing

To use the helper functions in a Mode Python Notebook, first install the package by adding this cell:

pip install ssmode -t "/tmp" > /dev/null 2>&1

You can then import various functions like:

from ssmode.tables import style_table

Styling Documentation

The functions in files bar_chart.py, kpi.py, tables.py are designed to "fake" the Mode Analytics built-in widgets from the Notebook.

Styling Tables

style_table(df, hl_type=None, n=3, bar_cols=[])

  • df: Pandas Dataframe (index will not be displayed)
  • hl_type: None or string 'nlargest', 'gradient' or 'bars' specifying cell highlighting type
  • n: integer > 0 specifying how many greatest cells will be highlighted (only applicable for hl_type='nlargest'), all numeric columns will get this style
  • bar_cols: array of strings specifying which columns will get the "bar charty style" (only applicable for hl_type='bars')
Styling Bar & Line Charts

style_bar_chart(ptl_fig, ytitle='') OR style_line_chart(ptl_fig, ytitle='')

  • ptl_fig: plotly chart with bars
  • ytitle: title on y-axis
Displaying KPI Widget

display_as_kpi(kpi_name, value)

  • kpi_name: string specifying KPI title/name (displayed on top)
  • value: value of the KPI (large value)

Processing Functions Documentation

Outlier Removal

prune_quotes(df, variable_col, group_cols, log_scale=True, k=1.5, max_diffs=[(2,3),(3,5),(4,10)])

  • df: Pandas Dataframe with data to remove outliers from
  • variable_col: string with column name based on which outliers will be removed (e.g. 'price')
  • group_cols: array of string(s) with columns to group df by for quartile calculation purposes (e.g. ['item_id'])
  • log_scale: boolean specifying whether to use logarithmic scale for outlier removal
  • k: float specifying limit ranges Q1-k*IQR and Q3+k*IQR
  • max_diffs: list of tuples with two values, each tuple specifies total number of quotes and the maximal allowed ratio between max/min quotes (if violated, RFQ will be removed before the IQR outlier detection method)

Metadata

Release files for ssmode 0.1.6

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

Source distribution (sdist)

Source distribution for ssmode 0.1.6
File Size Uploaded
ssmode-0.1.6.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ssmode 0.1.6
File Interpreter ABI Platform
ssmode-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / ssmode-0.1.6.tar.gz

Download URL ssmode-0.1.6.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9732a69efcd21812d99eff42c95f735204f1c830b017c2b1748623a9cd325ed5
BLAKE2b-256 checksum
How to use checksums
d14d63269fb73fa8823b1a33f65ccf9139d9adbed2151c48388fb0b1cf96b224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

Release files / ssmode-0.1.6-py3-none-any.whl

Download URL ssmode-0.1.6-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31d74968f48848e091f861092a4d5fa86200da60018133051b9cb85cad31a157
BLAKE2b-256 checksum
How to use checksums
f1edcbe39b5b1ccf7d986a3f4013e9e706a38e7a767034ee848d7b3c0da77a0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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