joemanji
joemanji
Mmarimo
Created by joemanji on 1/14/2024 in #archived-help-and-support
Customizing rendering in tables
I think 2 for me. I'd like to change whats rendered but keep the interactivity of mo.ui.dataframe if possible
11 replies
Mmarimo
Created by joemanji on 1/14/2024 in #archived-help-and-support
Customizing rendering in tables
Is there something I need to do to get it to display properly?
df = pd.DataFrame(
{
"A": [f'A{i}' for i in range(5)],
"B": [mo.Html(f'<b>B{i}</b>') for i in range(5)],
})
mo.ui.dataframe(df)
df = pd.DataFrame(
{
"A": [f'A{i}' for i in range(5)],
"B": [mo.Html(f'<b>B{i}</b>') for i in range(5)],
})
mo.ui.dataframe(df)
Just displays the repr or something like: <marimo._output.hypertext.Html object at 0x7f5a441af490>
11 replies
Mmarimo
Created by joemanji on 1/14/2024 in #archived-help-and-support
Customizing rendering in tables
df = pd.DataFrame(
{
"A": [f'A{i}' for i in range(100)],
"B": [f'B{i}' for i in range(100)],
})
sdf = df.style.format(formatter=lambda x: f'<b>{x}</b>', subset='B')
mo.ui.dataframe(sdf)
df = pd.DataFrame(
{
"A": [f'A{i}' for i in range(100)],
"B": [f'B{i}' for i in range(100)],
})
sdf = df.style.format(formatter=lambda x: f'<b>{x}</b>', subset='B')
mo.ui.dataframe(sdf)
Gives me:
Traceback (most recent call last):
Cell <cell-5>, line 7
mo.ui.dataframe(sdf)
File .../python3.10/site-packages/marimo/_plugins/ui/_impl/dataframes/dataframe.py, line 95, in __init__
"columns": df.dtypes.to_dict(),
AttributeError: '
Traceback (most recent call last):
Cell <cell-5>, line 7
mo.ui.dataframe(sdf)
File .../python3.10/site-packages/marimo/_plugins/ui/_impl/dataframes/dataframe.py, line 95, in __init__
"columns": df.dtypes.to_dict(),
AttributeError: '
11 replies