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
e3f29305
Commit
e3f29305
authored
Dec 12, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add shape
parent
f1a8239a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
ffm.py
tensnsorflow/ffm.py
+2
-3
No files found.
tensnsorflow/ffm.py
View file @
e3f29305
...
...
@@ -47,13 +47,12 @@ def get_data():
# print(df.head())
print
(
"shape"
)
print
(
df
.
shape
)
device_tuple
=
tuple
(
set
(
df
[
"device_id"
]
.
values
.
tolist
()))
df
=
pd
.
merge
(
df
,
get_statistics
(),
how
=
'left'
)
.
fillna
(
0
)
print
(
"merge"
)
print
(
df
.
head
())
print
(
"shape"
)
print
(
df
.
shape
)
df
=
df
.
drop
(
"device_id"
,
axis
=
1
)
#
df = df.drop("device_id", axis=1)
# transform(df)
...
...
@@ -100,7 +99,7 @@ def get_statistics():
sql
=
"select device_id,device_type,total,精选,直播,鼻部,眼部,微整,牙齿,轮廓,美肤抗衰,"
\
"吸脂,脂肪填充,隆胸,私密,毛发管理,公立,韩国 from home_tab_click"
df
=
con_sql
(
db
,
sql
)
.
drop_duplicates
()
df
=
df
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"device_type"
,
2
:
"
channel"
,
3
:
"
total"
})
df
=
df
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"device_type"
,
2
:
"total"
})
# for i in df.columns.difference(["device_id", "device_type","channel","total"]):
# df[i] = df[i]/df["total"]
# df = df.drop("total", axis=1)
...
...
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