code: def create_pandas_dataframe_agent(
      llm: BaseLanguageModel,
      df: Any,
      agent_type: AgentType = AgentType.ZERO_SHOT_REACT_DESCRIPTION,
      callback_manager: Optional[BaseCallbackManager] = None,
      prefix: Optional[str] = None,
      suffix: Optional[str] = None,
      input_variables: Optional[List[str]] = None,
      verbose: bool = False,
      return_intermediate_steps: bool = False,
      max_iterations: Optional[int] = 15,
      max_execution_time: Optional[float] = None,
      early_stopping_method: str = "force",
      agent_executor_kwargs: Optional[Dict[str, Any]] = None,
      include_df_in_prompt: Optional[bool] = True,
      number_of_head_rows: int = 5,
      extra_tools: Sequence[BaseTool] = (),
      format_instructions="",
      **kwargs: Any,
  ) -> AgentExecutor:
      """Construct a pandas agent from an LLM and dataframe."""
      warn_deprecated(
          since="0.0.314",
          message=(
              "On 2023-10-27 this module will be be deprecated from langchain, and "
              "will be available from the langchain-experimental package."
              "This code is already available in langchain-experimental."
              "See https://github.com/langchain-ai/langchain/discussions/11680."
          ),
          pending=True,
      )
      agent: BaseSingleActionAgent
      if agent_type == AgentType.ZERO_SHOT_REACT_DESCRIPTION:
          prompt, base_tools = _get_prompt_and_tools(
              df,
              prefix=prefix,
              suffix=suffix,
              input_variables=input_variables,
              include_df_in_prompt=include_df_in_prompt,
              number_of_head_rows=number_of_head_rows,
              format_instructions=format_instructions,
          )
          tools = base_tools + list(extra_tools)
          llm_chain = LLMChain(
              llm=llm,
              prompt=prompt,
              callback_manager=callback_manager,
          )
          tool_names = [tool.name for tool in tools]
          agent = ZeroShotAgent(
              llm_chain=llm_chain,
              allowed_tools=tool_names,
              callback_manager=callback_manager,
              **kwargs,
          )
      elif agent_type == AgentType.OPENAI_FUNCTIONS:
          _prompt, base_tools = _get_functions_prompt_and_tools(
              df,
              prefix=prefix,
              suffix=suffix,
              input_variables=input_variables,
              include_df_in_prompt=include_df_in_prompt,
              number_of_head_rows=number_of_head_rows,
          )
          tools = base_tools + list(extra_tools)
          agent = OpenAIFunctionsAgent(
              llm=llm,
              prompt=_prompt,
              tools=tools,
              callback_manager=callback_manager,
              **kwargs,
          )
      else:
          raise ValueError(
              f"Agent type {agent_type} not supported at the moment."
          )
      return AgentExecutor.from_agent_and_tools(
          agent=agent,
          tools=tools,
          callback_manager=callback_manager,
          verbose=verbose,
          return_intermediate_steps=return_intermediate_steps,
          max_iterations=max_iterations,
          max_execution_time=max_execution_time,
          early_stopping_method=early_stopping_method,
          **(agent_executor_kwargs or {}),
      )
  
imports: from io import IOBase
  from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
  from langchain._api import warn_deprecated
  from langchain.agents import AgentExecutor, BaseSingleActionAgent
  from langchain_experimental.agents.agent_toolkits.pandas.prompt import FUNCTIONS_WITH_DF, FUNCTIONS_WITH_MULTI_DF, MULTI_DF_PREFIX, MULTI_DF_PREFIX_FUNCTIONS, PREFIX, PREFIX_FUNCTIONS, SUFFIX_NO_DF, SUFFIX_WITH_DF, SUFFIX_WITH_MULTI_DF
  from langchain.agents.mrkl.base import ZeroShotAgent
  from langchain.agents.mrkl.prompt import FORMAT_INSTRUCTIONS
  from langchain.agents.openai_functions_agent.base import OpenAIFunctionsAgent
  from langchain.agents.types import AgentType
  from langchain.callbacks.base import BaseCallbackManager
  from langchain.chains.llm import LLMChain
  from langchain.schema import BasePromptTemplate
  from langchain.schema.language_model import BaseLanguageModel
  from langchain.schema.messages import SystemMessage
  from langchain.tools import BaseTool
  from langchain_experimental.tools.python.tool import PythonAstREPLTool
label_desc: Use image node_id 7 for calling a global function with example usage: create_pandas_dataframe_agent(llm, df, agent_type, callback_manager, prefix, suffix, input_variables, verbose, return_intermediate_steps, max_iterations, max_execution_time, early_stopping_method, agent_executor_kwargs, include_df_in_prompt, number_of_head_rows, extra_tools, format_instructions) and returns: AgentExecutor