The SmartDataframe class was the previous way to create dataframes in PandasAI. It provided similar functionality to the current semantic dataframes but with a different API.
from pandasai import SmartDataframeimport pandas as pd# Create a pandas DataFramedf = pd.DataFrame({ 'name': ['John', 'Emma', 'Alex', 'Sarah'], 'age': [28, 24, 32, 27], 'city': ['New York', 'London', 'Paris', 'Tokyo']})# Convert to SmartDataframesmart_df = SmartDataframe(df)# Ask questions about your dataresponse = smart_df.chat("What is the average age?")