code: def compute_pandas_digest(df) -> str:
      """Computes a digest for the given Pandas DataFrame.
  
      Args:
          df: A Pandas DataFrame.
  
      Returns:
          A string digest.
  
      """
      import numpy as np
      import pandas as pd
  
      # trim to max rows
      trimmed_df = df.head(MAX_ROWS)
  
      # keep string and number columns, drop other column types
      string_columns = trimmed_df.columns[
          (df.applymap(type) == str).all(0)
      ]
      numeric_columns = trimmed_df.select_dtypes(
          include=[np.number]
      ).columns
  
      desired_columns = string_columns.union(numeric_columns)
      trimmed_df = trimmed_df[desired_columns]
  
      return get_normalized_md5_digest(
          [
              pd.util.hash_pandas_object(trimmed_df).values,
              np.int64(len(df)),
          ]
          + [str(x).encode() for x in df.columns]
      )
  
file_path: mlflow/mlflow/data/digest_utils.py
imports: from typing import Any, List
  from packaging.version import Version
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.utils import insecure_hash
label_desc: Use image node_id 1 for calling a global function with example usage: compute_pandas_digest(df) and returns: get_normalized_md5_digest