user_query = "What is the average price of cars by type?"
textgen_config = TextGenerationConfig(n=1, temperature=0.2, use_cache=True)
charts = lida.visualize(summary=summary, goal=user_query, textgen_config=textgen_config)
charts[0]
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
Error-----
def plot(data: pd.DataFrame):
# solution plan
# i. group the data by Type and calculate the mean of Retail_Price
# ii. plot the grouped data using a barplot
sns.barplot(x='Type', y='Retail_Price', data=data.groupby('Type').mean().reset_index())
plt.title('What is the average price of cars by type?', wrap=True)
return plt;
chart = plot(data)
I am running the code in Microsoft Fabric Notbook
Generate visualization via a "user query"
agg function failed [how->mean,dtype->object]
IndexError Traceback (most recent call last) Cell In[25], line 5 3 textgen_config = TextGenerationConfig(n=1, temperature=0.2, use_cache=True) 4 charts = lida.visualize(summary=summary, goal=user_query, textgen_config=textgen_config)
----> 5 charts[0]
IndexError: list index out of range