-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to access non-existent attribute 'Figure' in plotly.express #1259
Comments
Hello, @harshvardhanchand! I'm here to assist you with any bugs, questions, or contributions you may have. Let's work together to solve the issue you're experiencing. To resolve the error "module 'plotly.express' has no attribute 'Figure'", you should use Here is an example of how you can create a figure using import plotly.graph_objects as go
# Create a figure
fig = go.Figure()
# Add a trace
fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6]))
# Show the figure
fig.show() Make sure you have the [tool.poetry.dependencies]
plotly = {version = "^5.15.0", optional = true} This should resolve the error and allow you to create and manipulate figures in your web application [1]. |
I want pandasai agent to recognise what to use and what not to use this reply doesn't make sense |
To ensure the Pandas AI agent automatically handles the correct Plotly module without manual intervention, you can install the optional You can install the pip install pandasai[plotly] This will include the Plotly module as part of the PandasAI installation, allowing the Pandas AI agent to handle Plotly without requiring manual intervention. The |
System Info
python version 3.11
Pandas Ai version 2.2.7
馃悰 Describe the bug
It is trying to access non existent attribute of Plotly Figure even with the Judge Agent enabled
![Screenshot 2024-06-29 at 12 38 06鈥疉M](https://private-user-images.githubusercontent.com/24714562/344292813-e53fbfe4-7ec6-4a96-af74-40a5d1b8a9da.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExNDIzMzMsIm5iZiI6MTcyMTE0MjAzMywicGF0aCI6Ii8yNDcxNDU2Mi8zNDQyOTI4MTMtZTUzZmJmZTQtN2VjNi00YTk2LWFmNzQtNDBhNWQxYjhhOWRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDE1MDAzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEzZmViMThkMzUyOWU0NDFkODMzYTg0ZDEwMTVhOTYxY2U3OTkwM2JmNmFlYmNlYWI2ZDVkY2JjZGVkNGE4YWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5zdTRJzQUGHwipheWBF-kQ8oLir54dEaCT-p7hYiLWo)
import os
import logging
import pandas as pd
import streamlit as st
import pickle
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import plotly.express as px
from some_module import PandasConnector, SmartDataframe, Agent, select_relevant_datasets, llm, judge, StreamlitResponse
def read_csv_and_metadata(code):
code = str(code)
report_file = 'REPORT_' + code + '.csv'
metadata_file = code + '_METADATA.csv'
report_path = os.path.join(folder_path, report_file)
metadata_path = os.path.join(folder_path, metadata_file)
Streamlit app initialization
try:
with open('preprocessed_data.pkl', 'rb') as f:
data = pickle.load(f)
preprocessed_corpus = data['preprocessed_corpus']
abbreviation_map = data['abbreviation_map']
except FileNotFoundError:
st.error("Data file not found. Please ensure the file is in the correct location.")
st.stop()
except pd.errors.EmptyDataError:
st.error("Data file is empty. Please provide a valid CSV file.")
st.stop()
except Exception as e:
st.error(f"An error occurred while loading the data file: {e}")
st.stop()
Streamlit UI setup
st.title("Query Response App")
st.write("Enter your query below and receive a response from the trained model.")
st.session_state['started'] = True
User interaction section
if 'started' in st.session_state and st.session_state['started']:
st.title("Chat")
The text was updated successfully, but these errors were encountered: