Spaces:
Build error
Build error
Download utils.py from vmalapaka/CSV_Data_Analysis_tool: direct link, hf CLI and curl.
- Browser
- Download file 300 Bytes
-
https://huggingface.co/spaces/vmalapaka/CSV_Data_Analysis_tool/resolve/main/utils.py
- Command line
-
hf download hf://spaces/vmalapaka/CSV_Data_Analysis_tool/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/vmalapaka/CSV_Data_Analysis_tool/resolve/main/utils.py
300 Bytes
| from langchain_experimental.agents import create_pandas_dataframe_agent | |
| import pandas as pd | |
| from langchain.llms import OpenAI | |
| def query_agent(data,query): | |
| df = pd.read_csv(data) | |
| llm = OpenAI() | |
| agent = create_pandas_dataframe_agent(llm,df,verbose = True) | |
| return agent.run(query) | |