class_docstr: wandb class for histograms.
  
  This object works just like numpy's histogram function
  https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html
  
  Examples:
      Generate histogram from a sequence
      ```python
      wandb.Histogram([1, 2, 3])
      ```
  
      Efficiently initialize from np.histogram.
      ```python
      hist = np.histogram(data)
      wandb.Histogram(np_histogram=hist)
      ```
  
  Arguments:
      sequence: (array_like) input data for histogram
      np_histogram: (numpy histogram) alternative input of a precomputed histogram
      num_bins: (int) Number of bins for the histogram.  The default number of bins
          is 64.  The maximum number of bins is 512
  
  Attributes:
      bins: ([float]) edges of bins
      histogram: ([int]) number of elements falling in each bin
code: def __init__(
      self,
      sequence: Optional[Sequence] = None,
      np_histogram: Optional["NumpyHistogram"] = None,
      num_bins: int = 64,
  ) -> None:
      if np_histogram:
          if len(np_histogram) == 2:
              self.histogram = (
                  np_histogram[0].tolist()
                  if hasattr(np_histogram[0], "tolist")
                  else np_histogram[0]
              )
              self.bins = (
                  np_histogram[1].tolist()
                  if hasattr(np_histogram[1], "tolist")
                  else np_histogram[1]
              )
          else:
              raise ValueError(
                  "Expected np_histogram to be a tuple of (values, bin_edges) or sequence to be specified"
              )
      else:
          np = util.get_module(
              "numpy",
              required="Auto creation of histograms requires numpy",
          )
  
          self.histogram, self.bins = np.histogram(
              sequence, bins=num_bins
          )
          self.histogram = self.histogram.tolist()
          self.bins = self.bins.tolist()
      if len(self.histogram) > self.MAX_LENGTH:
          raise ValueError(
              "The maximum length of a histogram is %i"
              % self.MAX_LENGTH
          )
      if len(self.histogram) + 1 != len(self.bins):
          raise ValueError("len(bins) must be len(histogram) + 1")
  
file_path: wandb/wandb/sdk/data_types/histogram.py
imports: import sys
  from typing import TYPE_CHECKING, Optional, Sequence, Tuple, Union
  from wandb import util
  from .base_types.wb_value import WBValue
label_desc: Use image node_id 1 to create a new Histogram object from inherited base classes: WBValue with example: obj = Histogram(sequence, np_histogram, num_bins)