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
c6d971ca
Commit
c6d971ca
authored
Nov 01, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加排序
parent
5b1854e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
ctr_exp.py
ctr_exp.py
+4
-8
No files found.
ctr_exp.py
View file @
c6d971ca
...
...
@@ -34,23 +34,19 @@ def ctr_all():
cursor
.
execute
(
sql_active
)
result
=
cursor
.
fetchall
()
tail56
=
pd
.
DataFrame
(
list
(
result
))[
0
]
.
values
.
tolist
()
print
(
"当天尾号5或6活跃用户总数:"
)
print
(
len
(
tail56
))
cover
=
list
(
set
(
tail56
)
&
set
(
device_id
))
id
=
list
()
c
id
=
list
()
number
=
list
()
for
i
in
cover
[
0
:
10
]
:
for
i
in
cover
:
sql
=
"select count(cid) from data_feed_exposure "
\
"where cid_type = 'diary'"
\
"and stat_date = '{}' and device_id = '{}';"
.
format
(
date
,
i
)
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchone
()[
0
]
id
.
append
(
i
)
c
id
.
append
(
i
)
number
.
append
(
result
)
df
=
pd
.
DataFrame
()
df
[
'id'
]
=
id
df
[
'id'
]
=
c
id
df
[
'number'
]
=
number
df
=
df
.
sort_values
(
by
=
"number"
,
ascending
=
False
)
df
.
to_csv
(
DIRECTORY_PATH
+
"exp.csv"
,
index
=
None
)
...
...
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