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

Method __init__

python-client/src/datapane/blocks/asset.py:196–215  ·  view source on GitHub ↗

Args: df: The pandas dataframe to attach to the report caption: A caption to display below the plot (optional) name: A unique name for the block to reference when adding text or embedding (optional) label: A label used when displaying the bloc

(
        self,
        df: pd.DataFrame,
        caption: t.Optional[str] = None,
        name: BlockId = None,
        label: str = None,
    )

Source from the content-addressed store, hash-verified

194 _tag = "DataTable"
195
196 def __init__(
197 self,
198 df: pd.DataFrame,
199 caption: t.Optional[str] = None,
200 name: BlockId = None,
201 label: str = None,
202 ):
203 """
204 Args:
205 df: The pandas dataframe to attach to the report
206 caption: A caption to display below the plot (optional)
207 name: A unique name for the block to reference when adding text or embedding (optional)
208 label: A label used when displaying the block (optional)
209 """
210 # create a copy of the df to process
211 df = to_df(df)
212 super().__init__(data=df, caption=caption, name=name, label=label)
213 # TODO - support pyarrow schema for local reports
214 (rows, columns) = df.shape
215 self.file_attribs = mk_attribs(rows=rows, columns=columns, schema="[]")

Callers

nothing calls this directly

Calls 3

to_dfFunction · 0.90
mk_attribsFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected