code: def compute_hist(psdf, bins):
      # 'data' is a Spark DataFrame that selects one column.
      assert isinstance(bins, (np.ndarray, np.generic))
  
      sdf = psdf._internal.spark_frame
      scols = []
      input_column_names = []
      for label in psdf._internal.column_labels:
          input_column_name = name_like_string(label)
          input_column_names.append(input_column_name)
          scols.append(
              psdf._internal.spark_column_for(label).alias(
                  input_column_name
              )
          )
      sdf = sdf.select(*scols)
  
      # 1. Make the bucket output flat to:
      #     +----------+-------+
      #     |__group_id|buckets|
      #     +----------+-------+
      #     |0         |0.0    |
      #     |0         |0.0    |
      #     |0         |1.0    |
      #     |0         |2.0    |
      #     |0         |3.0    |
      #     |0         |3.0    |
      #     |1         |0.0    |
      #     |1         |1.0    |
      #     |1         |1.0    |
      #     |1         |2.0    |
      #     |1         |1.0    |
      #     |1         |0.0    |
      #     +----------+-------+
      colnames = sdf.columns
      bucket_names = [
          "__{}_bucket".format(colname) for colname in colnames
      ]
  
      output_df = None
      for group_id, (colname, bucket_name) in enumerate(
          zip(colnames, bucket_names)
      ):
          # creates a Bucketizer to get corresponding bin of each value
          bucketizer = Bucketizer(
              splits=bins,
              inputCol=colname,
              outputCol=bucket_name,
              handleInvalid="skip",
          )
  
          bucket_df = bucketizer.transform(sdf)
  
          if output_df is None:
              output_df = bucket_df.select(
                  F.lit(group_id).alias("__group_id"),
                  F.col(bucket_name).alias("__bucket"),
              )
          else:
              output_df = output_df.union(
                  bucket_df.select(
                      F.lit(group_id).alias("__group_id"),
                      F.col(bucket_name).alias("__bucket"),
                  )
              )
  
      # 2. Calculate the count based on each group and bucket.
      #     +----------+-------+------+
      #     |__group_id|buckets| count|
      #     +----------+-------+------+
      #     |0         |0.0    |2     |
      #     |0         |1.0    |1     |
      #     |0         |2.0    |1     |
      #     |0         |3.0    |2     |
      #     |1         |0.0    |2     |
      #     |1         |1.0    |3     |
      #     |1         |2.0    |1     |
      #     +----------+-------+------+
      result = (
          output_df.groupby("__group_id", "__bucket")
          .agg(F.count("*").alias("count"))
          .toPandas()
          .sort_values(by=["__group_id", "__bucket"])
      )
  
      # 3. Fill empty bins and calculate based on each group id. From:
      #     +----------+--------+------+
      #     |__group_id|__bucket| count|
      #     +----------+--------+------+
      #     |0         |0.0     |2     |
      #     |0         |1.0     |1     |
      #     |0         |2.0     |1     |
      #     |0         |3.0     |2     |
      #     +----------+--------+------+
      #     +----------+--------+------+
      #     |__group_id|__bucket| count|
      #     +----------+--------+------+
      #     |1         |0.0     |2     |
      #     |1         |1.0     |3     |
      #     |1         |2.0     |1     |
      #     +----------+--------+------+
      #
      # to:
      #     +-----------------+
      #     |__values1__bucket|
      #     +-----------------+
      #     |2                |
      #     |1                |
      #     |1                |
      #     |2                |
      #     |0                |
      #     +-----------------+
      #     +-----------------+
      #     |__values2__bucket|
      #     +-----------------+
      #     |2                |
      #     |3                |
      #     |1                |
      #     |0                |
      #     |0                |
      #     +-----------------+
      output_series = []
      for i, (input_column_name, bucket_name) in enumerate(
          zip(input_column_names, bucket_names)
      ):
          current_bucket_result = result[result["__group_id"] == i]
          # generates a pandas DF with one row for each bin
          # we need this as some of the bins may be empty
          indexes = pd.DataFrame(
              {"__bucket": np.arange(0, len(bins) - 1)}
          )
          # merges the bins with counts on it and fills remaining ones with zeros
          pdf = indexes.merge(
              current_bucket_result, how="left", on=["__bucket"]
          ).fillna(0)[["count"]]
          pdf.columns = [input_column_name]
          output_series.append(pdf[input_column_name])
  
      return output_series
  
imports: import importlib
  import pandas
  import numpy
  from pandas.core.base import PandasObject
  from pandas.core.dtypes.inference import is_integer
  from pyspark.ml.feature import Bucketizer
  from pyspark.mllib.stat import KernelDensity
  from pyspark.sql import functions
  from pyspark.pandas.missing import unsupported_function
  from pyspark.pandas.config import get_option
  from pyspark.pandas.utils import name_like_string
label_desc: Use image node_id 3 for calling the HistogramPlotBase obj's underlying member method code with example usage: obj.compute_hist(psdf, bins) and returns: output_series