Streamlit component that allows you to select|click a cell in a table and get its rowId and columnIndex
Project description
streamlit-table-select-cell
Streamlit component that allows you to select|click a cell in a table and get its rowId and columnIndex. This is very useful when you want to dig into the detail of a cell in a pivoted dataframe.
Installation instructions
pip install streamlit-table-select-cell
Example
import streamlit as st
import pandas as pd
from st_table_select_cell import st_table_select_cell
st.subheader("Example of st_table_select_cell")
data = pd.DataFrame({'Dataset':['energy','traffic','syn'], 'Test':['ehistory','snapshot','aggmax'], 'PG': [3,6,9], 'TG':[2,5,7]})
st.dataframe(data)
selectedCell = st_table_select_cell(data)
st.write(selectedCell)
if selectedCell:
rowId = selectedCell['rowId']
colIndex = selectedCell['colIndex']
st.info('cell "{}" selected at row {} and col {} ({})'.format(
data.iat[int(rowId), colIndex], rowId, colIndex, data.columns[colIndex]))
st.write('selected row data: ', data.iloc[int(rowId)].to_dict())
else:
st.warning('no select')
Notes
version 0.3.3 only compatible with streamlit 1.30.0 version 0.3.4 is tested and compatible with streamlit 1.37.0 or higher
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit-table-select-cell-0.3.4.tar.gz.
File metadata
- Download URL: streamlit-table-select-cell-0.3.4.tar.gz
- Upload date:
- Size: 492.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00f68ab47e874bce5625b737fa29ad06fbfa4be43c8564657374172ba65d47f1
|
|
| MD5 |
41b05cc12639e9c768bd0d22dfd7da1b
|
|
| BLAKE2b-256 |
6ff3c9305650bdb9256958088fd3b2a92ce27637ca39ee4d8fbf1166c07bfab7
|
File details
Details for the file streamlit_table_select_cell-0.3.4-py3-none-any.whl.
File metadata
- Download URL: streamlit_table_select_cell-0.3.4-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a45ad8aa5314fba87a98b18c32f8619ddd243aa0f3098cc5641bbacf25a27e9
|
|
| MD5 |
bed1fb08ee3d6a75cce9ad3cda374748
|
|
| BLAKE2b-256 |
6981753fb06dc5770fb5d9d7dba643f9fa9a7202c157ad1c64570f1e4dcee1f8
|