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
0c65a30c
Commit
0c65a30c
authored
Aug 14, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete print
parent
16501f87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
userProfile.py
userProfile.py
+1
-1
utils.py
utils.py
+1
-5
No files found.
userProfile.py
View file @
0c65a30c
...
...
@@ -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
==
1
:
if
device_id_df
.
empty
:
print
(
"当下这一分钟没有活跃用户,不需要预测"
)
# 为了debug supervisor,修改了下面的return参数
return
1
,[
1
,
2
]
...
...
utils.py
View file @
0c65a30c
...
...
@@ -17,11 +17,7 @@ def con_sql(sql):
print
(
"成功从数据库获取数据"
)
df
=
pd
.
DataFrame
(
list
(
result
))
.
dropna
()
db
.
close
()
# 为了debug supervisor,加了下面的代码
if
df
.
empty
:
return
1
else
:
return
df
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