Ejemplo n.º 1
0
# -*- coding: utf-8 -*-

# Filters: individuals at least one time in the corps
from __future__ import division

import os
import pandas as pd
import numpy as np
from fonction_publique.base import raw_directory_path, get_careers, parser
from slugify import slugify
import matplotlib.pyplot as plt

fig_save_path = "C:/Users/l.degalle/CNRACL/fonction-publique/fonction_publique/ecrits/note_1_Lisa/Figures"

libelles_emploi_directory = parser.get('correspondances',
                                       'libelles_emploi_directory')
save_path = 'M:/CNRACL/output'

data_AT = pd.read_csv(
        os.path.join(save_path,"corps_AT_2011_w_echelon_conditions.csv")
        )

data_AT_echelon_2011_T1 = data_AT.query(
        '(annee == 2011) & (trimestre == 1)'
        )[['ident', 'echelon_y']]
data_AT_without_1st_transition = data_AT[
        ~data_AT['ident'].isin(data_AT_echelon_2011_T1['ident'].tolist()) &
                data_AT['echelon_y'].isin(
                        data_AT_echelon_2011_T1['echelon_y'].tolist()
                        )]
Ejemplo n.º 2
0
from __future__ import division

import logging
import os
import pandas as pd
import numpy as np
import sys

from fonction_publique.matching_grade.grade_matching import get_correspondance_data_frame
from fonction_publique.merge_careers_and_legislation import get_grilles
from fonction_publique.base import parser
from fonction_publique.matching_grade.grade_matching import validate_correspondance

log = logging.getLogger(__name__)

libelles_emploi_directory = parser.get('correspondances',
                                       'libelles_emploi_directory')
output_directory = parser.get('data', 'output')


def main():
    correspondance_data_frame = get_correspondance_data_frame(which='grade')
    valid_data_frame = validate_correspondance(correspondance_data_frame,
                                               check_only=True)
    assert valid_data_frame, 'The correspondace data frame is not valid'

    grilles = get_grilles()
    grilles.loc[grilles.libelle_grade_NEG == 'INFIRMIER DE CLASSE NORMALE (*)',
                'libelle_grade_NEG'] = 'INFIRMIER DE CLASSE NORMALE(*)'
    grilles.loc[grilles.libelle_grade_NEG ==
                'INFIRMIER DE CLASSE SUPERIEURE (*)',
                'libelle_grade_NEG'] = 'INFIRMIER DE CLASSE SUPERIEURE(*)'
Ejemplo n.º 3
0
import sys

import numpy as np
import pandas as pd
from slugify import slugify
from fuzzywuzzy import process

from fonction_publique.base import get_careers, parser, LIBELLES_MAX_ROWS
from fonction_publique.merge_careers_and_legislation import get_grilles

log = logging.getLogger(__name__)

DEBUG = False
VERSANTS = ['T', 'H']

correspondance_data_frame_path = parser.get('correspondances', 'h5')
corps_correspondance_data_frame_path = parser.get('correspondances',
                                                  'corps_h5')
libelles_emploi_directory = parser.get('correspondances',
                                       'libelles_emploi_directory')


def get_correspondance_data_frame(which=None, netneh=False):
    """
    Charge la table avec les libellés déjà classés.

    Returns
    -------
    data_frame : table de correspondance (chargée, ou nouvelle générée)
    """
    assert which in ['grade', 'corps'
Ejemplo n.º 4
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-


from __future__ import division

import logging
import pandas as pd

from fonction_publique.base import parser
from fonction_publique.matching_grade.grade_matching import select_grade_neg


log = logging.getLogger(__name__)

correspondance_data_frame_path = parser.get('correspondances', 'h5')
#correspondance_1 = pd.read_hdf(correspondance_data_frame_path, 'correspondance')
#try:
#    correspondance_2 = pd.read_hdf('C:/Users/s.rabate/Downloads/correspondances.h5', 'correspondance')
#except:
#    correspondance_2 = pd.read_hdf('/Users/simonrabate/Downloads/correspondances.h5', 'correspondance')




def validate_tables_to_merge(correspondance_data_frame1, correspondance_data_frame2):
    # 1. conflicting_entries
    df = correspondance_data_frame1.merge(
        correspondance_data_frame2,
        how = 'inner',
        on = ['versant', 'libelle', 'annee']