From 79a453134f9588792fc493390575d4412c72ce8c Mon Sep 17 00:00:00 2001 From: wuaho Date: Thu, 18 Nov 2021 14:10:38 +0800 Subject: [PATCH] 1 --- models/behavior_analysis.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/behavior_analysis.py b/models/behavior_analysis.py index f0e7b80..8a23fdf 100644 --- a/models/behavior_analysis.py +++ b/models/behavior_analysis.py @@ -8,6 +8,7 @@ import json from fastapi import Depends import pandas as pd +import numpy as np from sqlalchemy import func, or_, and_, not_ @@ -41,6 +42,7 @@ class CombinationEvent: result = round(result, 2) elif self.format == 'integer': result = result.astype(int) + result.replace(np.inf, 0, inplace=True) return result.to_list(), round(result.sum(), 2), round(result.mean(), 2)