Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
duizhang_tools
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
data—王林芳
duizhang_tools
Commits
b8953494
Commit
b8953494
authored
Nov 17, 2017
by
Perry_Zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
非去哪儿白条每日赔付
parent
3629203d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
白条直投每日赔付(用实还表出).py
白条/出表/白条直投每日赔付(用实还表出).py
+18
-2
No files found.
白条/出表/白条直投每日赔付
以loan_id为维度展开
(用实还表出).py
→
白条/出表/白条直投每日赔付(用实还表出).py
View file @
b8953494
...
...
@@ -195,6 +195,14 @@ def spread_loan_id():
[
'order_no'
,
'term_no'
,
'loan_paid_at'
,
'hk_day'
,
'tx_plan_all'
,
'tx_zc_principle'
,
'tx_yq_principle'
,
'tx_tq_principle'
,
'sr_plan_all'
,
'sr_zc_principle'
,
'sr_yq_principle'
,
'sr_tq_principle'
,
'zbj_plan_all'
,
'zbj_zc_principle'
,
'zbj_yq_principle'
,
'zbj_tq_principle'
]]
# 按日期出
df_out
=
df_hk_new
[[
'hk_day'
,
'tx_plan_all'
,
'tx_zc_principle'
,
'tx_yq_principle'
,
'tx_tq_principle'
,
'sr_plan_all'
,
'sr_zc_principle'
,
'sr_yq_principle'
,
'sr_tq_principle'
,
'zbj_plan_all'
,
'zbj_zc_principle'
,
'zbj_yq_principle'
,
'zbj_tq_principle'
]]
df_out
=
df_out
.
groupby
(
by
=
[
'hk_day'
])[
'tx_plan_all'
,
'tx_zc_principle'
,
'tx_yq_principle'
,
'tx_tq_principle'
,
'sr_plan_all'
,
'sr_zc_principle'
,
'sr_yq_principle'
,
'sr_tq_principle'
,
'zbj_plan_all'
,
'zbj_zc_principle'
,
'zbj_yq_principle'
,
'zbj_tq_principle'
]
.
sum
()
.
reset_index
()
df_hk_new
.
rename
(
columns
=
{
'hk_day'
:
'还款日期'
,
'tq_prin_total'
:
'客户提前可用本金'
,
'tx_zc_principle'
:
'提现账户客户正常还款本金'
,
'tx_yq_principle'
:
'提现账户客户逾期还款本金'
,
'tx_tq_principle'
:
'提现账户客户提前可用本金'
,
...
...
@@ -203,8 +211,16 @@ def spread_loan_id():
'tx_plan_all'
:
'提现账户应还资方本息'
,
'sr_plan_all'
:
'收入账户应还资方本息'
,
'zbj_plan_all'
:
'质保金账户应还资方本息'
,
'zbj_yq_principle'
:
'质保金账户客户逾期还款本金'
,
'zbj_tq_principle'
:
'质保金账户客户提前可用本金'
},
inplace
=
True
)
df_hk_new
.
to_excel
(
path
+
u'5_loan_id维度展开2017-10_3_11-16执行new.xlsx'
,
index
=
None
,
columns
=
df_hk_new
.
columns
,
df_out
.
rename
(
columns
=
{
'hk_day'
:
'还款日期'
,
'tq_prin_total'
:
'客户提前可用本金'
,
'tx_zc_principle'
:
'提现账户客户正常还款本金'
,
'tx_yq_principle'
:
'提现账户客户逾期还款本金'
,
'tx_tq_principle'
:
'提现账户客户提前可用本金'
,
'sr_zc_principle'
:
'收入账户客户正常还款本金'
,
'sr_yq_principle'
:
'收入账户客户逾期还款本金'
,
'sr_tq_principle'
:
'收入账户客户提前可用本金'
,
'zbj_zc_principle'
:
'质保金账户客户正常还款本金'
,
'tx_plan_all'
:
'提现账户应还资方本息'
,
'sr_plan_all'
:
'收入账户应还资方本息'
,
'zbj_plan_all'
:
'质保金账户应还资方本息'
,
'zbj_yq_principle'
:
'质保金账户客户逾期还款本金'
,
'zbj_tq_principle'
:
'质保金账户客户提前可用本金'
},
inplace
=
True
)
df_hk_new
.
to_excel
(
path
+
u'5_loan_id维度展开2017-10.xlsx'
,
index
=
None
,
columns
=
df_hk_new
.
columns
,
encoding
=
'utf8'
)
df_out
.
to_excel
(
path
+
u'5_按日期展开2017-10.xlsx'
,
index
=
None
,
columns
=
df_out
.
columns
,
encoding
=
'utf8'
)
spread_loan_id
()
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