Improves Tables PyDocs
@@ -145,18 +145,48 @@ def _json_helper(val, artifact):
class Table(Media):
- """This is a table designed to display sets of records.
+ """The Table class is used to display and analyze tabular data.
+
+ This class is the primary class used to generate the Table Visualizer
+ in the UI: https://docs.wandb.ai/guides/data-vis/tables.
+
+ Tables can be constructed with initial data using the `data` or
+ `dataframe` parameters. Additionally, users can add data to Tables
+ incrementally by using the `add_data`, `add_column`, and
+ `add_computed_column` functions for adding rows, columns, and computed
+ columns, respectively.
+
+ Tables can be logged directly to runs using `run.log({"my_table": table})`
+ or added to artifacts using `artifact.add(table, "my_table")`. Tables added
+ directly to runs will produce a corresponding Table Visualizer in the
+ Workspace which can be used for further analysis and exporting to reports.
+ Tables added to artifacts can be viewed in the Artifact Tab and will render
+ an equivalent Table Visualizer directly in the artifact browser.
+
+ Note that Tables support numerous types of data: traditional scalar values,
+ numpy arrays, and most subclasses of wandb.data_types.Media. This means you
+ can embed Images, Video, Audio, and other sorts of rich, annotated media
+ directly in Tables, alongside other traditional scalar values. Tables expect
+ each value for a column to be of the same type. By default, a column supports
+ optional values, but not mixed values. If you absolutely need to mix types,
+ you can enable the `allow_mixed_types` flag which will disable type checking
+ on the data. This will result in some table analytics features being disabled
+ due to lack of consistent typing.
Arguments:
- columns: ([str]) Names of the columns in the table.
+ columns: (List[str]) Names of the columns in the table.
Defaults to ["Input", "Output", "Expected"].
- data: (array) 2D Array of values that will be displayed as strings.
+ data: (List[List[any]]) 2D row-oriented array of values.
dataframe: (pandas.DataFrame) DataFrame object used to create the table.
- When set, the other arguments are ignored.
- optional (Union[bool,List[bool]]): If None values are allowed. Singular bool
+ When set, `data` and `columns` arguments are ignored.
+ optional: (Union[bool,List[bool]]) Determines if `None` values are allowed. Default to True
+ - If a singular bool value, then the optionality is enforced for all
+ columns specified at construction time
+ - If a list of bool values, then the optionality is applied to each
+ column - should be the same length as `columns`
applies to all columns. A list of bool values applies to each respective column.
- Default to True.
- allow_mixed_types (bool): Determines if columns are allowed to have mixed types (disables type validation). Defaults to False
+ allow_mixed_types: (bool) Determines if columns are allowed to have mixed types
+ (disables type validation). Defaults to False
"""
MAX_ROWS = 10000
