execute_multiline_pandas_on_html_table
Execute multi-line pandas code on EnergyPlus HTML table data to analyze simulation results. Access the table as 'df' and assign output to 'result' to return values.
Instructions
Execute multi-line pandas code on HTML table data from an EnergyPlus model.
Retrieves an HTML table and executes multi-line pandas code on it. The dataframe is available as 'df' in your code. Use 'result = ...' to return values.
Args: id: The model_id of the EnergyPlus model (obtain from get_available_models). query_tuple: A tuple containing (zone/component, report_name, table_name) to identify the table. code: Multi-line Python code to execute
Returns: String representation of the result or execution status.
Examples: # Complex table analysis code = ''' # Convert numeric columns numeric_cols = df.select_dtypes(include=[np.number]).columns df_numeric = df[numeric_cols]
# Calculate totals and percentages
totals = df_numeric.sum()
percentages = (df_numeric / totals) * 100
result = percentages
'''
execute_multiline_pandas_on_html_table(model_id, query_tuple, code)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| code | Yes | ||
| query_tuple | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |