1.优化分布分析元素去重数,列表去重数,集合去重数没有数据的问题
This commit is contained in:
parent
a65a023f1d
commit
aaa4cd63ee
@ -1015,9 +1015,9 @@ async def scatter_model(
|
||||
if df.empty:
|
||||
return schemas.Msg(code=-9, msg='无数据', data=None)
|
||||
if 'list' in str(type(df['values'][0])):
|
||||
f=lambda x:x[0]
|
||||
df['values']=df['values'].map(f)
|
||||
|
||||
# f=lambda x:x[0]
|
||||
# df['values']=df['values'].map(f)
|
||||
df = df.explode("values").reset_index(drop=True)
|
||||
#df['values']=df['values'].astype(str)
|
||||
df.fillna(0, inplace=True)
|
||||
#转换数据类型为int
|
||||
@ -1190,8 +1190,9 @@ async def scatter_model(
|
||||
if df.empty:
|
||||
return schemas.Msg(code=-9, msg='无数据', data=None)
|
||||
if 'list' in str(type(df['values'][0])):
|
||||
f = lambda x: x[0]
|
||||
df['values'] = df['values'].map(f)
|
||||
# f = lambda x: x[0]
|
||||
# df['values'] = df['values'].map(f)
|
||||
df = df.explode("values").reset_index(drop=True)
|
||||
df.fillna(0, inplace=True)
|
||||
# 转换数据类型为int
|
||||
df['values'] = df['values'].astype(int)
|
||||
|
@ -295,6 +295,16 @@ class Settings(BaseSettings):
|
||||
'id': 'not in',
|
||||
'title': '不是'
|
||||
},
|
||||
],
|
||||
'array': [
|
||||
{
|
||||
'id': 'is not null',
|
||||
'title': '有值'
|
||||
},
|
||||
{
|
||||
'id': 'is null',
|
||||
'title': '无值'
|
||||
}
|
||||
]
|
||||
}
|
||||
ARITHMETIC = {
|
||||
@ -302,6 +312,7 @@ class Settings(BaseSettings):
|
||||
'-': lambda x, y: x - y,
|
||||
'*': lambda x, y: x * y,
|
||||
'/': lambda x, y: x / y,
|
||||
#'%': lambda x, y:(x)-int(x/y)*(y) 取模用
|
||||
}
|
||||
|
||||
PROPHET_TIME_GRAIN_MAP = {
|
||||
@ -389,7 +400,7 @@ class Settings(BaseSettings):
|
||||
|
||||
|
||||
class Debug(Settings):
|
||||
MDB_HOST: str = '10.0.0.7'
|
||||
MDB_HOST: str = '10.0.0.9'
|
||||
MDB_PORT: int = 27017
|
||||
MDB_USER: str = 'root'
|
||||
MDB_PASSWORD: str = 'iamciniao'
|
||||
|
@ -611,7 +611,7 @@ ORDER BY level
|
||||
event = self.events[0]
|
||||
event_name = event['eventName']
|
||||
analysis = event['analysis']
|
||||
if analysis == 'list_distinct':
|
||||
if analysis in ['list_distinct',"set_distinct","ele_distinct"]:
|
||||
analysis = 'max'
|
||||
e_account_id_col = getattr(self.event_tbl.c, '#account_id').label('uid')
|
||||
u_account_id_col = getattr(self.user_tbl.c, '#account_id')
|
||||
|
Loading…
Reference in New Issue
Block a user