-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds new pages to tables chapter. #516
Changes from 5 commits
0bdff35
7498bc4
053ea08
031a5ed
d15ab72
b7e5504
1bb1d2f
101312f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
description: Create tables with W&B. | ||
displayed_sidebar: default | ||
--- | ||
|
||
# Create a table | ||
|
||
Unlike traditional spreadsheets, Tables support numerous types of data. This includes | ||
scalar values, strings, NumPy arrays, and most subclasses of `wandb.data_types.Media`. | ||
You can embed `Images`, `Video`, `Audio`, and other sorts of rich, annotated media | ||
directly in Tables, alongside other traditional scalar values. | ||
|
||
Construct tables with initial data by creating a dataframe: | ||
|
||
|
||
```python | ||
import pandas as pd | ||
import wandb | ||
|
||
#Intialize the data | ||
data = {"users": ["geoff", "juergen", "ada"], "feature_01": [1, 117, 42]} | ||
#Turn the data into a dataframe. | ||
df = pd.DataFrame(data) | ||
|
||
tbl = wandb.Table(data=df) | ||
assert all(tbl.get_column("users") == df["users"]) | ||
assert all(tbl.get_column("feature_01") == df["feature_01"]) | ||
``` | ||
## Add data | ||
|
||
Add data to Tables incrementally by using the | ||
`add_data`, `add_column`, and `add_computed_column` functions for | ||
adding rows, columns, and columns computed from data in other columns, respectively: | ||
|
||
|
||
```python | ||
import wandb | ||
|
||
tbl = wandb.Table(columns=["user"]) | ||
|
||
users = ["geoff", "juergen", "ada"] | ||
|
||
[tbl.add_data(user) for user in users] | ||
assert tbl.get_column("user") == users | ||
|
||
|
||
def get_user_name_length(index, row): | ||
return {"feature_01": len(row["user"])} | ||
|
||
|
||
tbl.add_computed_columns(get_user_name_length) | ||
assert tbl.get_column("feature_01") == [5, 7, 3] | ||
``` | ||
|
||
## Log data | ||
|
||
Log tables directly to runs with `run.log({"my_table": table})` | ||
or add them to artifacts using `artifact.add(table, "my_table")`: | ||
|
||
|
||
```python | ||
import numpy as np | ||
import wandb | ||
|
||
wandb.init() | ||
|
||
tbl = wandb.Table(columns=["image", "label"]) | ||
|
||
images = np.random.randint(0, 255, [2, 100, 100, 3], dtype=np.uint8) | ||
labels = ["panda", "gibbon"] | ||
[tbl.add_data(wandb.Image(image), label) for image, label in zip(images, labels)] | ||
|
||
wandb.log({"classifier_out": tbl}) | ||
``` | ||
|
||
Tables added directly to runs produces a corresponding Table Visualizer in the | ||
Workspace which can further analyze data and export it to reports. | ||
|
||
Tables added to artifacts appear in the Artifact tab and render | ||
an equivalent Table Visualizer directly in the artifact browser. | ||
|
||
## Best practices | ||
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 turns off type checking on the data. This results in some table analytics features turning off due to lack of consistent typing. | ||
|
||
## Next steps | ||
- For more information about visualizing tables, see the [table visualization guide](./visualize-tables.md). | ||
- For a more in-depth walkthrough of how to use tables, see the [walkthrough](tables-walkthrough.md). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
description: Manage tables with W&B. | ||
displayed_sidebar: default | ||
--- | ||
|
||
katjacksonWB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Manage tables | ||
|
||
Once you [create a table](./tables-create.md), you can use the W&B platform to analyze, customize, and manage you data. | ||
|
||
## The W&B platform | ||
Check warning on line 10 in docs/guides/tables/tables-navigate.md
|
||
When first opening your workspace, you can see a simple visualization of your tables. Each table you create appears in a `panel` where you can further customize your data. | ||
|
||
There is also a statement on the top of your panel. If you're following one of the example guides, this statement should bevalv `runs.summary["Table Name"]`. You can also edit this statement. | ||
Check failure on line 13 in docs/guides/tables/tables-navigate.md
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spell check |
||
|
||
In a default scenario, your table displays all of your runs, with each run having its own color so you can easily differentiate them. | ||
|
||
## Run commands | ||
Clicking on the funnel icon brings up the filter menu. This allows you to run various commands to filter your data. For example, if you wanted to only show columns that were alphanumeric, you could write something like `row["a"].isAlnum`. | ||
|
||
Currently, you can filter by: | ||
- index | ||
- project | ||
- row | ||
- range | ||
|
||
For more information on visualizing tables, see the [full guide](./visualize-tables.md) | ||
|
||
## Export data | ||
Easily export your table data to a .csv file by clicking the `Export to CSV` button, usually located at the bottom of a table's panel. Clicking this button automatically downloads a .csv file of your current table, with any formats or editing you have made. | ||
|
||
For more methods of exporting data, see the [full guide](./tables-download.md). | ||
|
||
## Next steps | ||
For a more in-depth walkthrough of how to use tables, see the [walkthrough](tables-walkthrough.md). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
description: How to create tables. | ||
displayed_sidebar: ja | ||
--- | ||
|
||
# Create a Table | ||
Check warning on line 6 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
|
||
Unlike traditional spreadsheets, Tables support numerous types of data: | ||
scalar values, strings, numpy arrays, and most subclasses of `wandb.data_types.Media`. | ||
Check failure on line 9 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
This means you can embed `Images`, `Video`, `Audio`, and other sorts of rich, annotated media | ||
directly in Tables, alongside other traditional scalar values. | ||
|
||
Tables can be constructed with initial data using the `data` or | ||
Check notice on line 13 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
`dataframe` parameters: | ||
|
||
|
||
```python | ||
import pandas as pd | ||
import wandb | ||
|
||
data = {"users": ["geoff", "juergen", "ada"], "feature_01": [1, 117, 42]} | ||
df = pd.DataFrame(data) | ||
|
||
tbl = wandb.Table(data=df) | ||
assert all(tbl.get_column("users") == df["users"]) | ||
assert all(tbl.get_column("feature_01") == df["feature_01"]) | ||
``` | ||
## Add Data | ||
Check warning on line 28 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
|
||
You can add data to Tables incrementally by using the | ||
`add_data`, `add_column`, and `add_computed_column` functions for | ||
adding rows, columns, and columns computed from data in other columns, respectively: | ||
|
||
|
||
```python | ||
import wandb | ||
|
||
tbl = wandb.Table(columns=["user"]) | ||
|
||
users = ["geoff", "juergen", "ada"] | ||
|
||
[tbl.add_data(user) for user in users] | ||
assert tbl.get_column("user") == users | ||
|
||
|
||
def get_user_name_length(index, row): | ||
return {"feature_01": len(row["user"])} | ||
|
||
|
||
tbl.add_computed_columns(get_user_name_length) | ||
assert tbl.get_column("feature_01") == [5, 7, 3] | ||
``` | ||
|
||
## Log Data | ||
Check warning on line 54 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
|
||
Tables can be logged directly to runs using `run.log({"my_table": table})` | ||
Check notice on line 56 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
or added to artifacts using `artifact.add(table, "my_table")`: | ||
|
||
|
||
```python | ||
import numpy as np | ||
import wandb | ||
|
||
wandb.init() | ||
|
||
tbl = wandb.Table(columns=["image", "label"]) | ||
|
||
images = np.random.randint(0, 255, [2, 100, 100, 3], dtype=np.uint8) | ||
labels = ["panda", "gibbon"] | ||
[tbl.add_data(wandb.Image(image), label) for image, label in zip(images, labels)] | ||
|
||
wandb.log({"classifier_out": tbl}) | ||
``` | ||
|
||
Tables added directly to runs as above will produce a corresponding Table Visualizer in the | ||
Check warning on line 75 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
Workspace which can be used for further analysis and exporting to reports. | ||
Check notice on line 76 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
|
||
Tables added to artifacts can be viewed in the Artifact Tab and will render | ||
Check notice on line 78 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
an equivalent Table Visualizer directly in the artifact browser. | ||
|
||
## Best Practices | ||
Check warning on line 81 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
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. | ||
Check warning on line 82 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
|
||
## Next Steps | ||
Check warning on line 84 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
- For more information about visualizing tables, see our [table visualization guide](./visualize-tables.md). | ||
Check warning on line 85 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
||
- For a more in-depth walkthrough of how to use tables, see our [walkthrough](tables-walkthrough.md). | ||
Check warning on line 86 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-create.md
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
description: How to use the W&B platform to manage tables. | ||
displayed_sidebar: ja | ||
--- | ||
|
||
# Manage Tables | ||
Check warning on line 6 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
|
||
Once you've [created a table](./tables-create.md), you can use the W&B platform to analyze, customize, and manage you data. | ||
|
||
## The W&B Platform | ||
Check warning on line 10 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
When you first open your workspace, you will be presented with a simple visualization of your tables. Each table you create appears in a `panel` where you can further customize your data. | ||
Check warning on line 11 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
|
||
You'll also notice a statement on the top of your panel. If you're following one of our example guides, it will look something like `runs.summary["Table Name"]`. You can edit this statement, which will be discussed later. | ||
Check warning on line 13 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
|
||
In a default scenario, your table will display all of your runs, with each run having its own color so you can easily differentiate them. | ||
Check warning on line 15 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
|
||
## Run Commands | ||
Check warning on line 17 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
Clicking on the funnel icon will bring up the filter menu. This will allow you to run various commands to filter your data. For example, if you wanted to only show columns that were alphanumeric, you could write something like `row["a"].isAlnum`. | ||
Check warning on line 18 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
|
||
Currently, you can filter by: | ||
- index | ||
- project | ||
- row | ||
- range | ||
|
||
For more information on visualizing tables, see our [full guide](./visualize-tables.md) | ||
Check warning on line 26 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
|
||
## Export Data | ||
Check warning on line 28 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
You can easily export your table data to a .csv file by clicking the `Export to CSV` button, usually located at the bottom of a table's panel. Clicking this button automatically downloads a .csv file of your current table, with any formats or editing you have made. | ||
|
||
For more methods of exporting data, see our [full guide](./tables-download.md). | ||
Check warning on line 31 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
|
||
## Next Steps | ||
Check warning on line 33 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
||
For a more in-depth walkthrough of how to use tables, see our [walkthrough](tables-walkthrough.md). | ||
Check warning on line 34 in i18n/ja/docusaurus-plugin-content-docs/current/guides/tables/tables-navigate.md
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: "Now" -> "Next,"