Closed bkxndata closed 9 months ago
@bkxndata The columns parameter is a list of column definitions, where each item describes a column to be included. See pytabulator column docs. By default all columns are included with some default values.
The easiest way to get an example of how to use the columns parameter is by using utils.create_columns
:
import pandas as pd
from pytabulator.utils import create_columns
df = pd.read_csv("https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv")
for col in create_columns(df):
print(col)
# Adding a default filter to all columns:
for col in create_columns(df, default_filter=True):
print(col)
{'title': 'PassengerId', 'field': 'PassengerId', 'hozAlign': 'right', 'headerFilter': 'number'}
{'title': 'Survived', 'field': 'Survived', 'hozAlign': 'right', 'headerFilter': 'number'}
...
@bkxndata If everything works for you, I would close this issue.
yes! thank you so much
first off, this project is awesome. love playing around with it.
i tried to incorporate filters into the data table and had some trouble. it seems whenever I use the columns parameter it gets rid of / hides the data in the table.
Here is my sample code. just uncomment either of the columns parameters and run