How can I avoid (too many values to show) problem in dash_pivottable?

Viewed 18

I'm using dash_pivottable library. Example code is below. The problem is that when I'm using it on df3 which is referring to huge '.csv' I can't use filter in table. Because there are too many rows dash_pivottable can't show it as in excel. It says that there is too many values to show. How can I find a solution and make using a filter possible?

enter image description here

import dash_bootstrap_components as dbc
from dash import Input, Output, html
import dash
from dash import html, dcc
import dash_bootstrap_components as dbc

import pandas as pd
import dash_pivottable

df2=pd.DataFrame({"Sales QTY":[10,20,30,40],
                 "Sales Person":['Jack', 'Adam', 'Ken', 'Jack'],
                 "Product":["Apple", "Orange","Apple","Cherry"]
                 })

df2=pd.concat([df2.columns.to_frame().T, df2], ignore_index=True).values.tolist()


df=pd.read_csv('data/grouped.csv')
df3=pd.concat([df.columns.to_frame().T, df], ignore_index=True).values.tolist()

app = dash.Dash(__name__)
server = app.server

app.layout = html.Div(
    [
        # Header("Dash Pivottable", app),
        dash_pivottable.PivotTable(
            id="table",
            data=df3,
            cols=['year_belge','month_belge'],
            
            rows=['HrcMalGrTn','Ad 1'],
            
            vals=['     Sip.Mik.(D'],
            
        ),
        html.Div(id="output"),
    ])
if __name__ == "__main__":
    app.run_server(debug=False, port=8001)
0 Answers
Related