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
e558e5d7
Commit
e558e5d7
authored
Aug 09, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
fix bug
parents
426684e7
c3106702
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
userProfile.py
userProfile.py
+2
-0
No files found.
userProfile.py
View file @
e558e5d7
...
@@ -26,9 +26,11 @@ def fetch_user_profile(device_id):
...
@@ -26,9 +26,11 @@ def fetch_user_profile(device_id):
sql
=
"select device_id,city_id from data_feed_click where device_id = '{0}' limit 1"
.
format
(
device_id
)
sql
=
"select device_id,city_id from data_feed_click where device_id = '{0}' limit 1"
.
format
(
device_id
)
user_profile
=
con_sql
(
sql
)
user_profile
=
con_sql
(
sql
)
if
user_profile
.
empty
:
if
user_profile
.
empty
:
print
(
"没有获取到该用户对应的city_id"
)
return
{},
user_profile
.
empty
return
{},
user_profile
.
empty
user_profile
=
user_profile
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"city_id"
})
user_profile
=
user_profile
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"city_id"
})
print
(
"成功获取该用户对应的city_id"
)
user_profile_dict
=
{}
user_profile_dict
=
{}
for
i
in
user_profile
.
columns
:
for
i
in
user_profile
.
columns
:
user_profile_dict
[
i
]
=
user_profile
.
loc
[
0
,
i
]
user_profile_dict
[
i
]
=
user_profile
.
loc
[
0
,
i
]
...
...
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