execute_multiline_pandas_on_timeseries
Run multi-line pandas code on EnergyPlus timeseries data to compute custom analyses like monthly peaks or hourly patterns.
Instructions
Execute multi-line pandas code on timeseries data from an EnergyPlus model.
Retrieves timeseries data for a specific variable and executes multi-line pandas code on it. The dataframe is available as 'df' in your code. Use 'result = ...' to return values.
Args: model_id: The model_id of the EnergyPlus model (obtain from get_available_models). rddid: List of RDD IDs for the desired variables (obtain from get_sql_available_hourlies). code: Multi-line Python code to execute
Returns: String representation of the result or execution status.
Examples: # Complex analysis with multiple steps code = ''' df['hour'] = df['dt'].dt.hour df['month'] = df['dt'].dt.month monthly_peaks = df.groupby('month')['Value'].max() result = monthly_peaks ''' execute_multiline_pandas_on_timeseries(model_id, rddid, code)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| rddid | Yes | ||
| model_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |