mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-27 17:08:47 +00:00
Adding code to allow pandas to show all columns instead of truncating… (#7901)
- Description: Adding code to set pandas dataframe to display all the columns. Otherwise, some data get truncated (it puts a "..." in the middle and just shows the first 4 and last 4 columns) and the LLM doesn't realize it isn't getting the full data. Default value is 8, so this helps Dataframes larger than that. - Issue: none - Dependencies: none - Tag maintainer: @hinthornw - Twitter handle: none
This commit is contained in:
parent
c416dbe8e0
commit
aea97efe8b
@ -118,6 +118,8 @@ def _get_prompt_and_tools(
|
|||||||
) -> Tuple[BasePromptTemplate, List[PythonAstREPLTool]]:
|
) -> Tuple[BasePromptTemplate, List[PythonAstREPLTool]]:
|
||||||
try:
|
try:
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
|
pd.set_option("display.max_columns", None)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"pandas package not found, please install with `pip install pandas`"
|
"pandas package not found, please install with `pip install pandas`"
|
||||||
@ -227,6 +229,8 @@ def _get_functions_prompt_and_tools(
|
|||||||
) -> Tuple[BasePromptTemplate, List[PythonAstREPLTool]]:
|
) -> Tuple[BasePromptTemplate, List[PythonAstREPLTool]]:
|
||||||
try:
|
try:
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
|
pd.set_option("display.max_columns", None)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"pandas package not found, please install with `pip install pandas`"
|
"pandas package not found, please install with `pip install pandas`"
|
||||||
|
Loading…
Reference in New Issue
Block a user