cancel
Showing results for 
Search instead for 
Did you mean: 

Quest -Rolling average model

Aadesh
7 - Data Storage
7 - Data Storage

Here I am trying to create a rolling average quest model however Quest fails to load the model when deployed 

Here is the code :

from sisense import pandas as pd
import json

def main(event, context):
window = 5

# Format JSON into data frame for easy manipulation
data = event['data']
df = pd.DataFrame()
for col in data:
if col['datatype'] == "numeric":
df[col['name']] = col['values']

# Calculate rolling average
df["rolling"] = df.iloc[:, 0].rolling(window=window).mean()

# Return output in JSON
output = df.to_dict(orient='records')

return output

 

 

0 REPLIES 0