code: def _pandas_compute_data_summary(data):
      """Perform computation for summary statistics and data description.
  
      Args:
          data: The dataframe
  
      Raises:
          ValueError: Invalid input data type.
  
      Returns:
          The Pandas dataframe with metrics in rows
      """
      if _is_series(data):
          data = pd.DataFrame(data, columns=[data.name])
  
      if not _is_dataframe(data):
          raise ValueError("Data must be a Pandas DataFrame")
  
      info_data = pd.DataFrame(
          {
              "Info": [
                  data.shape[0],
                  data.shape[1],
                  _sizeof_fmt(data.memory_usage().sum()),
              ]
          },
          index=["Rows", "Columns", "Size in Memory"],
      )
  
      columns = data.columns
      val = data.values
      num_columns = data.select_dtypes("number").columns
      num_ind = np.nonzero([c in num_columns for c in columns])[0]
      date_columns = data.select_dtypes(
          ["datetime", "datetimetz"]
      ).columns
      date_ind = np.nonzero([c in date_columns for c in columns])[0]
      other_columns = data.select_dtypes(
          exclude=["number", "datetime", "datetimetz"]
      ).columns
      other_ind = np.nonzero([c in other_columns for c in columns])[0]
      order = np.concatenate([num_ind, date_ind, other_ind], axis=0)
  
      dtypes = data.dtypes[order]
      s_mean = np.pad(
          np.mean(val[:, num_ind], axis=0),
          (0, len(data.columns) - num_ind.size),
          constant_values=np.nan,
      )
      s_sd = np.pad(
          np.std(val[:, num_ind].astype(np.float), axis=0),
          (0, len(data.columns) - num_ind.size),
          constant_values=np.nan,
      )
      s_med = np.pad(
          np.median(val[:, num_ind], axis=0),
          (0, len(data.columns) - num_ind.size),
          constant_values=np.nan,
      )
      s_min = np.pad(
          np.min(val[:, np.concatenate([num_ind, date_ind])], axis=0),
          (0, len(data.columns) - num_ind.size - date_ind.size),
          constant_values=np.nan,
      )
      s_max = np.pad(
          np.max(val[:, np.concatenate([num_ind, date_ind])], axis=0),
          (0, len(data.columns) - num_ind.size - date_ind.size),
          constant_values=np.nan,
      )
      s_zero = (data == 0).sum()[order]
      s_null = data.isnull().sum().astype(int)[order]
      s_unique = data.nunique()[order]
      s_freq = np.apply_along_axis(mode1, 0, val.astype("str"))[order]
  
      summary_data = pd.DataFrame(
          np.vstack(
              [
                  dtypes,
                  s_null,
                  s_zero,
                  s_min,
                  s_med,
                  s_max,
                  s_mean,
                  s_sd,
                  s_unique,
                  s_freq,
              ]
          ).transpose()[np.argsort(order), :],
          columns=[
              "Data Type",
              "Nulls",
              "Zeros",
              "Min",
              "Median",
              "Max",
              "Mean",
              "Standard Deviation",
              "Unique",
              "Top Frequency",
          ],
          index=data.columns,
      )
  
      return SummaryWidget(data, info_data, summary_data)
  
imports: from typing import Dict, Callable, Optional
  import warnings
  import pandas
  from pandas.core.dtypes.common import is_float
  import numpy
  from data_describe._widget import BaseWidget
  from data_describe.compat import _requires, _compat, _is_series, _is_dataframe
  from data_describe.backends._backends import _get_compute_backend
label_desc: Use image node_id 3 for calling a global function with example usage: _pandas_compute_data_summary(data) and returns: SummaryWidget