Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
leximpact-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
Simulateur dotations aux communes
leximpact-server
Commits
38d3a06a
Commit
38d3a06a
authored
Jun 30, 2020
by
sandcha
Browse files
Options
Downloads
Patches
Plain Diff
Extract dataframe initialization in helper
parent
8225e3f3
No related branches found
No related tags found
1 merge request
!20
Nbptr in results
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Simulation_engine/simulate_pop_from_reform.py
+7
-6
7 additions, 6 deletions
Simulation_engine/simulate_pop_from_reform.py
with
7 additions
and
6 deletions
Simulation_engine/simulate_pop_from_reform.py
+
7
−
6
View file @
38d3a06a
...
...
@@ -194,6 +194,11 @@ def calcule_personnes_touchees(impots_par_reforme):
return
foyers_fiscaux_touches
def
dataframe_pondere
(
dictionnaire_simulations
:
Dict
)
->
pandas
.
DataFrame
:
# Pondération des foyers fiscaux : une ligne par foyer fiscal, une colonne pour le poids (wprm)
return
next
(
iter
(
dictionnaire_simulations
.
values
()))[
1
][
"
foyer_fiscal
"
][[
"
wprm
"
]]
def
compare
(
period
:
str
,
dictionnaire_simulations
,
compute_deciles
=
True
):
res
:
Total
=
{}
if
(
...
...
@@ -202,12 +207,8 @@ def compare(period: str, dictionnaire_simulations, compute_deciles=True):
# Donc il doit déjà être dans resulats_de_base
impots_par_reforme
=
resultats_de_base
.
copy
()
else
:
impots_par_reforme
=
next
(
iter
(
dictionnaire_simulations
.
values
()))[
1
][
"
foyer_fiscal
"
][[
"
wprm
"
]]
nbptr_par_reforme
=
next
(
iter
(
dictionnaire_simulations
.
values
()))[
1
][
"
foyer_fiscal
"
][[
"
wprm
"
]]
impots_par_reforme
=
dataframe_pondere
(
dictionnaire_simulations
)
nbptr_par_reforme
=
dataframe_pondere
(
dictionnaire_simulations
)
for
nom_simulation
in
dictionnaire_simulations
:
impots_par_reforme
[
nom_simulation
]
=
dictionnaire_simulations
[
nom_simulation
][
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment