bethschoen / Rotombot

A Chatbot powered by ChatGPT that supports the automatic analysis of data. Currently analyses Pokemon data.
0 stars 0 forks source link

change graph df structure #5

Open ismailmo1 opened 1 year ago

ismailmo1 commented 1 year ago

https://github.com/bethryanamey/Rotombot/blob/37a1adfd85d9a81321062ce80f766398cce95538/variables.py#L25-L43

use dict data structure and rename stages so it's sequential and easier to index (no need to group stages)

bethschoen commented 1 year ago

I'm not sure how to use a dict object to find which step needs to be completed next in the conversation. Currently, I use Pandas to filter the graph_df to understand progress. For example, stage 1 in the graph_df is for getting information on the graph the user wants to create:

graph_df = pd.DataFrame([
    [1, 'data_required',"Please describe the data you would like in the visual", False, None],
    [1, 'visualisation_description', "Please describe how you would like this data to be visualised (i.e. plot type and axis variables)", False, None],
    [1, 'customisation_options',"Is there anything else you would like to customise on the graph? Enter 'no' if not", False, None],
...
, columns=["stage", "variable", "prompt", "completed", "input"])

I then use the completed column in graph_df to understand whether we have collected all the information we need:

...
# we know something about what the user wants but not all of it
elif any(graph_df[graph_df.stage == 1]["completed"] == False):
...

How do I do this with a dictionary?