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
0b7df7a5
Commit
0b7df7a5
authored
Aug 22, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print
parent
b02c21eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
diaryQueueUpdate.py
diaryQueueUpdate.py
+8
-4
No files found.
diaryQueueUpdate.py
View file @
0b7df7a5
...
@@ -10,6 +10,7 @@ from multiprocessing import Pool
...
@@ -10,6 +10,7 @@ from multiprocessing import Pool
from
config
import
*
from
config
import
*
import
json
import
json
from
sklearn.preprocessing
import
MinMaxScaler
from
sklearn.preprocessing
import
MinMaxScaler
import
time
def
test_con_sql
(
device_id
):
def
test_con_sql
(
device_id
):
db
=
pymysql
.
connect
(
host
=
'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
,
port
=
3306
,
user
=
'doris'
,
db
=
pymysql
.
connect
(
host
=
'rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com'
,
port
=
3306
,
user
=
'doris'
,
...
@@ -145,15 +146,15 @@ def merge_score(x_list, score_df):
...
@@ -145,15 +146,15 @@ def merge_score(x_list, score_df):
cursor
.
execute
(
sql
)
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchall
()
result
=
cursor
.
fetchall
()
score
=
pd
.
DataFrame
(
list
(
result
))
score
=
pd
.
DataFrame
(
list
(
result
))
print
(
"数据库日记表前十行"
)
#
print("数据库日记表前十行")
print
(
score
)
#
print(score)
score_list
=
score
[
0
]
.
values
.
tolist
()
score_list
=
score
[
0
]
.
values
.
tolist
()
db
.
close
()
db
.
close
()
score_df
[
"score"
]
=
score_df
[
"score"
]
+
score_list
score_df
[
"score"
]
=
score_df
[
"score"
]
+
score_list
print
(
"sum"
)
#
print("sum")
print
(
score_df
)
#
print(score_df)
return
score_df
return
score_df
...
@@ -214,6 +215,7 @@ def multi_update(key, name_dict):
...
@@ -214,6 +215,7 @@ def multi_update(key, name_dict):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
start
=
time
.
time
()
warnings
.
filterwarnings
(
"ignore"
)
warnings
.
filterwarnings
(
"ignore"
)
# TODO 上线后把预测用户改成多进程预测
# TODO 上线后把预测用户改成多进程预测
data_set_cid
=
pd
.
read_csv
(
DIRECTORY_PATH
+
"data_set_cid.csv"
)[
"cid"
]
.
values
.
tolist
()
data_set_cid
=
pd
.
read_csv
(
DIRECTORY_PATH
+
"data_set_cid.csv"
)[
"cid"
]
.
values
.
tolist
()
...
@@ -225,6 +227,8 @@ if __name__ == "__main__":
...
@@ -225,6 +227,8 @@ if __name__ == "__main__":
for
key
in
name_dict
.
keys
():
for
key
in
name_dict
.
keys
():
multi_update
(
key
,
name_dict
)
multi_update
(
key
,
name_dict
)
end
=
time
.
time
()
print
(
end
-
start
)
# pool = Pool(4)
# pool = Pool(4)
# for key in name_dict.keys():
# for key in name_dict.keys():
# pool.apply_async(multi_update,(key,name_dict,))
# pool.apply_async(multi_update,(key,name_dict,))
...
...
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