Skip to content
Snippets Groups Projects
Commit bf8bf178 authored by Alice Brenon's avatar Alice Brenon
Browse files

Add dictionary to retrieve the Id of a domain by its name

parent deabb234
No related branches found
No related tags found
No related merge requests found
...@@ -30,5 +30,7 @@ domains = [ ...@@ -30,5 +30,7 @@ domains = [
'Pêche', 'Religion', 'Spectacle', 'Superstition' 'Pêche', 'Religion', 'Spectacle', 'Superstition'
] ]
domainId = dict([(domains[k], k) for k in range(0, len(domains))])
def domain(articles, name): def domain(articles, name):
return articles[articles.ensemble_domaine_enccre == name] return articles[articles.ensemble_domaine_enccre == name]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment