class_docstr: Validate a dataframe using a Pydantic schema.
  
  Attributes:
      df: dataframe to be validated
class_docstr_tok: ["Validate","a","dataframe","using","a","Pydantic","schema",".","Attributes",":","df",":","dataframe","to","be","validated"]
docstr: Args:
      schema: Pydantic schema to be validated for the dataframe row
  
  Returns:
      Validation results
docstr_tok: ["Args",":","schema",":","Pydantic","schema","to","be","validated","for","the","dataframe","row","Returns",":","Validation","results"]
code: def validate(self, schema: BaseModel) -> DfValidationResult:
      """
      Args:
          schema: Pydantic schema to be validated for the dataframe row
  
      Returns:
          Validation results
      """
      dataframe_type = df_type(self._df)
      if dataframe_type is None:
          raise ValueError("Unsupported DataFrame")
  
      df_json: List[Dict] = self._df_to_list_of_dict(
          self._df, dataframe_type
      )
  
      errors = self._validate_batch(schema, df_json)
  
      return DfValidationResult(len(errors) == 0, errors)
  
file_path: pandas-ai/pandasai/helpers/df_validator.py
imports: from typing import List, Dict
  from pydantic import ValidationError
  from pydantic import BaseModel
  from pandasai.helpers.df_info import DataFrameType, df_type
label_desc: Use image node_id 4 for calling the DfValidator obj's underlying member method code with example usage: obj.validate(schema) and returns: DfValidationResult