Skip to content

Latest commit

 

History

History
97 lines (80 loc) · 2.38 KB

README.md

File metadata and controls

97 lines (80 loc) · 2.38 KB

Streamlit dataframe display

alternative to st.table with configuration displaying Pandas DataFrame

PyPI - Version PyPI - License PyPI - Downloads PyPI - Implementation PyPI - Wheel PyPI - Format PyPI - Python Version

Installation instructions

pip install st-df-table

Usage instructions

import pandas as pd
from st_df_table import st_table

data = {
    "Column A": [1, 2, 3, 4, 5, 6],
    "Column C": [True, False, True, False, True, False],
    "Column B": ["A", "B", "C", "F", "G", "H"],
}

df = pd.DataFrame(data)
st_table(df)

table-1

st_table(
    df,
    head_align="left",
    data_align="left",
    head_bg_color="red",
    head_color="blue",
    head_font_weight="normal",
    border_color="red",
    border_width="3",
)

table-2

st_table(
    df,
    head_align="right",
    data_align="right",
    data_bg_color="green",
    data_color="yellow",
    data_font_weight="bold",
    bordered=False,
    sortable=False,
)

table-3

import string
import numpy as np
import pandas as pd
from st_df_table import st_table

df = pd.DataFrame(
    {
        "Column A": list(range(1, 101)),
        "Column B": np.random.choice(list(string.ascii_uppercase), size=100),
        "Column C": np.random.rand(100),
    }
)

st_table(
    df,
    border_width=4,
    border_color="red",
    paginated=True,
    pagination_size_per_page=7,
    pagination_bar_size=4,
    pagination_text_color="blue",
    pagination_bg_color="yellow",
    pagination_border_color="green",
    pagination_active_color="yellow",
)

table-4

Cloud example

https://mysiar-org-st-table-st-df.streamlit.app/