> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I log a list of values?

You can log a list of values, such as per-step losses, with [`wandb.Run.log()`](/models/ref/python/experiments/run/#method-runlog/). The following examples show two common approaches: log the list as a dictionary entry, or log it as a histogram to visualize its distribution.

<Tabs>
  <Tab title="As a dictionary">
    ```python theme={null}
    import wandb

    # Initialize a new run
    with wandb.init(project="log-list-values", name="log-dict") as run:
        # Log losses as a dictionary
        losses = [0.1, 0.2, 0.3, 0.4, 0.5]
        run.log({"losses": losses})
        run.log({f"losses/loss-{ii}": loss for ii, loss in enumerate(losses)})
    ```
  </Tab>

  <Tab title="As a histogram">
    ```python theme={null}
    import wandb

    # Initialize a new run
    with wandb.init(project="log-list-values", name="log-hist") as run:
        # Log losses as a histogram
        losses = [0.1, 0.2, 0.3, 0.4, 0.5]
        run.log({"losses": wandb.Histogram(losses)})
    ```
  </Tab>
</Tabs>

For more information, see [Log objects and media](/models/track/log/).

***

<Badge stroke shape="pill" color="orange" size="md">[Logs](/support/models/tags/logs)</Badge><Badge stroke shape="pill" color="orange" size="md">[Experiments](/support/models/tags/experiments)</Badge>
