pandas DataFrames: <dataframe> Dataframe dfs[0], with 10 rows and 3 columns. This is the metadata of the dataframe dfs[0]: country,gdp,happiness_index United Kingdom,1194260612,7.16 United States,5382530119,6.94 Germany,7427242378,7.07 France,3889391010,6.66 Italy,5937009073,6.38 </dataframe> データフレームのサンプルデータ ただし enforce_privacy 設定が有効なら省略 参照:generate_python_code.tmpl, _generate_dataframes(), _get_sample_head() データフレームの行列数と ヘッダを埋め込み 複数データフレームの場合は上記を繰り返す
5 countries by GDP </conversation> This is the initial python code to be updated: ```python # TODO import all the dependencies required import pandas as pd 参照:generate_python_code.tmpl ユーザーが chat() の引数として 与えた自然言語クエリを埋め込み Pandas 以外のライブラリ使う コードを生成するなら import 増やしてね、という気持ち
Analyze the data 1. Prepare: Preprocessing and cleaning data if necessary 2. Process: Manipulating data for analysis (grouping, filtering, aggregating, etc.) 3. Analyze: Conducting the actual analysis (if the user asks to plot a chart save it to an image in temp_chart.png and do not show the chart.) 参照:generate_python_code.tmpl, GeneratePythonCodePrompt() ask, prepare, process, analyze, share, act というデータ分析の 6段階フレームワーク中の 3段階に対応してね という気持ち ユーザーが Custom Instructions を指定していなければ そちらにも同文を設定
update the python code based on the last question in the conversation. Updated code: ということで うまいことコード生成してね という気持ち • 上記は SmartDataframe の last_prompt で確認可能 生成箇所:generate_python_code.tmpl