class_docstr: Class which stores vertex and edge properties that can be used to construct
  Graphs from individual property selections and used later to annotate graph
  algorithm results with corresponding properties.
class_docstr_tok: ["Class","which","stores","vertex","and","edge","properties","that","can","be","used","to","construct","Graphs","from","individual","property","selections","and","used","later","to","annotate","graph","algorithm","results","with","corresponding","properties","."]
docstr: Set the dtype for columns in df using the dtypes in column_dtype_dict.
  This also handles converting standard integer dtypes to nullable
  integer dtypes, needed to accommodate NA values in columns.
code: def __update_dataframe_dtypes(df, column_dtype_dict):
      """
      Set the dtype for columns in df using the dtypes in column_dtype_dict.
      This also handles converting standard integer dtypes to nullable
      integer dtypes, needed to accommodate NA values in columns.
      """
      update_cols = {}
      for col, dtype in column_dtype_dict.items():
          if col not in df.columns:
              continue
          # If the DataFrame is Pandas and the dtype is an integer type,
          # ensure a nullable integer array is used by specifying the correct
          # dtype. The alias for these dtypes is simply a capitalized string
          # (eg. "Int64")
          # https://pandas.pydata.org/pandas-docs/stable/user_guide/missing_data.html#integer-dtypes-and-missing-data
          dtype_str = str(dtype)
          if dtype_str in ["int32", "int64"]:
              dtype_str = dtype_str.title()
          if str(df.dtypes[col]) != dtype_str:
              # Assigning to df[col] produces a (false?) warning with Pandas,
              # but assigning to df.loc[:,col] does not update the df in
              # cudf, so do one or the other based on type.
              update_cols[col] = df[col].astype(dtype_str)
      if not update_cols:
          return df
      # Use df.assign to avoid assignment into df in case df is a view:
      # https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html
      # #returning-a-view-versus-a-copy
      # Note that this requires all column names to be strings.
      return df.assign(**update_cols)
  
imports: import cudf
  import numpy
  import cugraph
  from cugraph.utilities.utils import import_optional, MissingModule, create_list_series_from_2d_ar
  from typing import Union
label_desc: Use image node_id 44 for calling the EXPERIMENTAL__PropertyGraph obj's underlying member method code with example usage: obj.__update_dataframe_dtypes(df, column_dtype_dict) and returns: df, df