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
28d237fa
Commit
28d237fa
authored
6 years ago
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add app list
parent
e1c927f2
master
gyz
mr/beta/bug22
offic
rtt
test
updatedb
wzw
zhao
zhao22
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
applist.py
tensnsorflow/applist.py
+2
-2
No files found.
tensnsorflow/applist.py
View file @
28d237fa
...
@@ -29,7 +29,7 @@ def json_format(x):
...
@@ -29,7 +29,7 @@ def json_format(x):
def
sort_app
():
def
sort_app
():
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_prod'
)
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_prod'
)
sql
=
"select device_id,app_list from device_id_applist"
sql
=
"select device_id,app_list from device_id_applist
limit 60
"
df
=
con_sql
(
db
,
sql
)
.
dropna
()
df
=
con_sql
(
db
,
sql
)
.
dropna
()
df
=
df
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"app_list"
})
df
=
df
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"app_list"
})
df
=
df
.
loc
[
df
[
"app_list"
]
.
apply
(
is_json
)]
df
=
df
.
loc
[
df
[
"app_list"
]
.
apply
(
is_json
)]
...
@@ -71,7 +71,7 @@ def sort_app():
...
@@ -71,7 +71,7 @@ def sort_app():
df
[
"app_list"
]
=
df
[
"app_list"
]
.
apply
(
json_format
)
df
[
"app_list"
]
=
df
[
"app_list"
]
.
apply
(
json_format
)
for
i
in
category
.
keys
():
for
i
in
category
.
keys
():
df
[
i
]
=
df
[
"app_list"
]
.
apply
(
lambda
x
:
1
if
len
(
x
&
category
[
i
])
>
0
else
0
)
df
[
i
]
=
df
[
"app_list"
]
.
apply
(
lambda
x
:
1
if
len
(
x
&
category
[
i
])
>
0
else
0
)
df
=
df
.
drop
(
"app_list"
,
axis
=
1
)
yconnect
=
create_engine
(
'mysql+pymysql://root:3SYz54LS9#^9sBvC@10.66.157.22:4000/jerry_test?charset=utf8'
)
yconnect
=
create_engine
(
'mysql+pymysql://root:3SYz54LS9#^9sBvC@10.66.157.22:4000/jerry_test?charset=utf8'
)
pd
.
io
.
sql
.
to_sql
(
df
,
"app_list_sort"
,
yconnect
,
schema
=
'jerry_test'
,
if_exists
=
'replace'
,
index
=
False
)
pd
.
io
.
sql
.
to_sql
(
df
,
"app_list_sort"
,
yconnect
,
schema
=
'jerry_test'
,
if_exists
=
'replace'
,
index
=
False
)
...
...
This diff is collapsed.
Click to expand it.
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