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
be0e6bfd
Commit
be0e6bfd
authored
Dec 26, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print
parent
3324cdaa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
data2ffm.py
eda/esmm/Feature_pipline/data2ffm.py
+3
-3
exp_channel.py
tensnsorflow/exp_channel.py
+23
-0
No files found.
eda/esmm/Feature_pipline/data2ffm.py
View file @
be0e6bfd
...
...
@@ -114,10 +114,10 @@ class multiFFMFormatPandas:
x
=
0
while
True
:
if
x
+
step
<
data
.
__len__
():
data_list
.
append
(
data
.
loc
[
x
:
x
+
step
])
x
=
x
+
step
+
1
data_list
.
append
(
data
.
i
loc
[
x
:
x
+
step
])
x
=
x
+
step
else
:
data_list
.
append
(
data
.
loc
[
x
:
data
.
__len__
()])
data_list
.
append
(
data
.
i
loc
[
x
:
data
.
__len__
()])
break
return
data_list
...
...
tensnsorflow/exp_channel.py
0 → 100644
View file @
be0e6bfd
import
pandas
as
pd
import
pymysql
def
con_sql
(
db
,
sql
):
cursor
=
db
.
cursor
()
try
:
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchall
()
df
=
pd
.
DataFrame
(
list
(
result
))
except
Exception
:
print
(
"发生异常"
,
Exception
)
df
=
pd
.
DataFrame
()
finally
:
db
.
close
()
return
df
def
exp
():
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_test'
)
sql
=
"select manufacturer,channel from user_feature"
df
=
con_sql
(
db
,
sql
)
print
(
"manufacturer unique"
)
print
(
len
(
df
[
0
]
.
unique
()))
\ No newline at end of file
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