Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
a6d98355
Commit
a6d98355
authored
Aug 14, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for debug supervisor,change get_active_users,con_sql
parent
cc482f19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
userProfile.py
userProfile.py
+1
-1
utils.py
utils.py
+5
-1
No files found.
userProfile.py
View file @
a6d98355
...
...
@@ -12,7 +12,7 @@ def get_active_users():
sql
=
"select device_id from user_active_time "
\
"where active_time <= '{}' and active_time >= '{}'"
.
format
(
now_end
,
now_start
)
device_id_df
=
con_sql
(
sql
)
if
device_id_df
.
empty
:
if
device_id_df
==
"0"
:
print
(
"当下这一分钟没有活跃用户,不需要预测"
)
# 为了debug supervisor,修改了下面的return参数
return
1
,[
1
,
2
]
...
...
utils.py
View file @
a6d98355
...
...
@@ -16,7 +16,11 @@ def con_sql(sql):
result
=
cursor
.
fetchall
()
df
=
pd
.
DataFrame
(
list
(
result
))
.
dropna
()
db
.
close
()
return
df
# 为了debug supervisor,加了下面的代码
if
df
.
empty
:
return
"0"
else
:
return
df
# 把数据写到redis里
# TODO 生产环境的redis地址没有提供,下面的地址是测试环境的,需要改成生产环境地址
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment