Skip to content

Commit

Permalink
Utilise numpy.ljust au lieu de startswith
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauko Quiroga committed Jan 6, 2020
1 parent 611e762 commit b7a7c5a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions openfisca_france/model/prestations/logement_social.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from numpy import isin, logical_not as not_, select
from numpy.core.defchararray import startswith
from numpy import char, isin, logical_not as not_, select

from openfisca_core.indexed_enums import Enum
from openfisca_core.periods import MONTH
Expand Down Expand Up @@ -69,7 +68,7 @@ class zone_logement_social(Variable):
def formula(menage, period):
depcom = menage('depcom', period)
in_paris_communes_limitrophes = isin(depcom, paris_communes_limitrophes)
in_idf = isin([True], startswith(depcom, departements_idf))
in_idf = isin(char.ljust(depcom, 2), departements_idf)

return select(
[
Expand Down

0 comments on commit b7a7c5a

Please sign in to comment.