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
7cf96872
Commit
7cf96872
authored
Oct 08, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change
parent
4a2b20ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
meigou.py
local/meigou.py
+13
-6
No files found.
local/meigou.py
View file @
7cf96872
...
...
@@ -54,8 +54,8 @@ def all_click(x):
total
.
append
(
tmp
)
sum
=
sum
+
tmp
total
.
append
(
sum
)
print
(
total
)
return
t
otal
return
t
uple
(
total
)
def
cpc_click
(
x
):
...
...
@@ -110,9 +110,8 @@ def cpc_click(x):
sum
=
sum
+
tmp
cpc
.
append
(
sum
)
print
(
cpc
)
return
cpc
return
tuple
(
cpc
)
...
...
@@ -129,13 +128,21 @@ if __name__ == '__main__':
clicks
=
[]
cpcs
=
[]
for
i
in
range
(
1
,
3
):
clicks
.
ext
end
(
all_click
(
i
))
cpcs
.
ext
end
(
cpc_click
(
i
))
clicks
.
app
end
(
all_click
(
i
))
cpcs
.
app
end
(
cpc_click
(
i
))
print
(
"clicks"
)
print
(
clicks
)
print
(
"cpcs"
)
print
(
cpcs
)
rdd
=
spark
.
sparkContext
.
parallelize
(
cpcs
)
df
=
spark
.
createDataFrame
(
rdd
)
.
toDF
.
toPandas
()
df
.
to_csv
(
'/home/gmuser/cpc.csv'
,
index
=
False
)
rdd
=
spark
.
sparkContext
.
parallelize
(
clicks
)
df
=
spark
.
createDataFrame
(
rdd
)
.
toDF
.
toPandas
()
df
.
to_csv
(
'/home/gmuser/clicks.csv'
,
index
=
False
)
spark
.
stop
()
...
...
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