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
0762305f
Commit
0762305f
authored
Dec 20, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加apply参数
parent
ffb90508
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ffm.py
tensnsorflow/ffm.py
+5
-5
No files found.
tensnsorflow/ffm.py
View file @
0762305f
...
...
@@ -155,7 +155,10 @@ def get_data():
df
=
df
.
rename
(
columns
=
{
0
:
"y"
,
1
:
"z"
,
2
:
"stat_date"
,
3
:
"ucity_id"
,
4
:
"clevel1_id"
,
5
:
"ccity_name"
,
6
:
"device_type"
,
7
:
"manufacturer"
,
8
:
"channel"
,
9
:
"top"
,
10
:
"time"
,
11
:
"cid_id"
})
print
(
"esmm data ok"
)
df
[
"video"
]
=
df
[
"cid_id"
]
.
apply
(
video_judge
)
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_prod'
)
sql
=
"select cid from diary_video"
diary_video
=
con_sql
(
db
,
sql
)[
0
]
.
values
.
tolist
()
df
[
"video"
]
=
df
[
"cid_id"
]
.
apply
(
video_judge
,
args
=
(
diary_video
,))
df
=
df
.
drop
(
"cid_id"
,
axis
=
1
)
print
(
df
.
head
(
2
))
...
...
@@ -179,10 +182,7 @@ def get_data():
ucity_id
=
list
(
set
(
df
[
"ucity_id"
]
.
values
.
tolist
()))
return
df
,
validate_date
,
ucity_id
,
ccity_name
def
video_judge
(
cid
):
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_prod'
)
sql
=
"select cid from diary_video"
diary_video
=
con_sql
(
db
,
sql
)[
0
]
.
values
.
tolist
()
def
video_judge
(
cid
,
diary_video
):
if
cid
in
diary_video
:
return
"yes"
else
:
...
...
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