sxd3125 commited on
Commit
797592e
1 Parent(s): 72cc2b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -25,5 +25,10 @@ pandas_ai = PandasAI(llm, save_charts =True, conversational=False, verbose=True)
25
  # Enter Prompt related to data or Select from Pre-defined for demo purposes.
26
  prompt = 'Plot the histogram of countries showing for each the gdp, using different colors for each bar' #@param [ "What is the relation between GDP and Happines Index", "Plot the histogram of countries showing for each the gpd, using different colors for each bar", "GDP of Top 5 Happiest Countries?"] {allow-input: true}
27
  response = pandas_ai.run(df, prompt=prompt,
28
- is_conversational_answer=False)
29
- print(response.xlabel)
 
 
 
 
 
 
25
  # Enter Prompt related to data or Select from Pre-defined for demo purposes.
26
  prompt = 'Plot the histogram of countries showing for each the gdp, using different colors for each bar' #@param [ "What is the relation between GDP and Happines Index", "Plot the histogram of countries showing for each the gpd, using different colors for each bar", "GDP of Top 5 Happiest Countries?"] {allow-input: true}
27
  response = pandas_ai.run(df, prompt=prompt,
28
+ is_conversational_answer=False)
29
+ w = response.properties()
30
+ print("Display all Properties\n")
31
+ for i in w:
32
+ print(i, ":", w[i])
33
+ print(response._label)
34
+ plt.savefig('text.png', response)