MCPcopy Create free account
hub / github.com/datapane/datapane / gen_table_df

Function gen_table_df

python-client/src/datapane/builtins.py:82–85  ·  view source on GitHub ↗

Return a test complex df for adding to a DataTable

(rows: int = 4, alphabet: str = "ABCDEF")

Source from the content-addressed store, hash-verified

80
81
82def gen_table_df(rows: int = 4, alphabet: str = "ABCDEF") -> pd.DataFrame:
83 """Return a test complex df for adding to a DataTable"""
84 data = [{x: random.randint(0, 1000) for x in alphabet} for _ in range(0, rows)]
85 return pd.DataFrame.from_dict(data)
86
87
88def gen_plot() -> alt.Chart:

Callers 1

demoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected