Beispiel #1
0
def statistic_number(df, mysql_url):
    """
    人数(权重)分析
    :param df:
    :param mysql_url:
    :return:
    """

    parameters = [
        (["company_name"], "position_category", ("company__salary",
                                                 "salary_range")),
        (["company_name"], "position_category", ("company__gender", "gender")),
        (["company_name"], "position_category", ("company__address",
                                                 "address")),
        (["company_name"], "position_category", ("company__school",
                                                 "school_name")),
        (["company_name"], "position_category", ("company__major", "major")),
        (["company_name"], "position_category", ("company__degree", "degree")),
        (["industry"], None, ("industry__address", "address")),
        (["industry"], "address", ("industry__address__salary",
                                   "salary_range")),
        (["industry"], "address", ("industry__address__gender", "gender")),
        (["industry"], "address", ("industry__address__salary_work_year",
                                   "work_year_range,salary_range")),
        (["position_name"], None, ("position__address", "address")),
        (["position_name"], "address", ("position__address__salary_range",
                                        "salary_range")),
        (["position_name"], "address", ("position__address__age_range",
                                        "age_range")),
        (["position_name"], "address", ("position__address__salary_work_year",
                                        "work_year_range,salary_range")),
    ]

    statistic_dimension(df, mysql_url, parameters, statistic_number_dimension)
Beispiel #2
0
def statistic_salary(df, mysql_url):
    """
    薪资分析
    :param df:
    :param mysql_url:
    :return:
    """

    parameters = [
        # 专业维度相关分析
        (["major"], "degree", ("major__gender", "gender")),
        (["major"], "degree", ("major__address", "address")),
        (["major"], "degree", ("major__company", "company_name")),
        (["major"], "degree", ("major__industry", "industry")),

        # 学校维度相关分析
        (["school_name"], "degree", ("school__gender", "gender")),
        (["school_name"], "degree", ("school__address", "address")),
        (["school_name"], "degree", ("school__company", "company_name")),
        (["school_name"], "degree", ("school__industry", "industry")),

        # 学校 + 专业  相关维度的分析
        (["school_name", "major"], "degree", ("school__major__position",
                                              "position_name", True, True)),
        (["school_name", "major"], "degree", ("school__major__industry",
                                              "industry", True, True)),
        (["school_name", "major"], "degree", ("school__major__company",
                                              "company_name", True, True)),
        (["school_name", "major"], "degree",
         ("school__major__flow", "company_name,industry", True, True)),
        (["industry"], "address", ("industry__address__compare", None, True,
                                   True)),
        (["industry"], "address", ("industry__address__age", "age_range")),
        (["industry"], "address", ("industry__address__degree", "degree")),

        # 职位 + 地点 相关维度分析
        (["position_name"], "address", ("position__address__compare", None,
                                        True, True)),
        (["position_name"], "address", ("position__address__gender",
                                        "gender")),
        (["position_name"], "address", ("position__address__work_year_range",
                                        "work_year_range")),
        (["position_name"], "address", ("position__address__degree",
                                        "degree")),
        (["address"], "gender", ("person__rank", "age", True, True, True)),

        # 含职位别名
        (["major"], "degree", ("major__position", "position_name", True, False,
                               False, True)),
        (["school_name"], "degree", ("school__position", "position_name", True,
                                     False, False, True))
    ]

    statistic_dimension(df, mysql_url, parameters, statistic_salary_dimension)
Beispiel #3
0
def statistic_major_position(profile_df, education_df, work_df, mysql_url):
    """
    专业对口职位统计
    :param df:
    :param mysql_url:
    :return:
    """
    # 最后一份教育经历
    latest_education_df = education_df.filter(
        education_df.edu_index == 1).filter(education_df.school_area == "中国")
    resume_df = profile_df.join(latest_education_df,
                                "resume_id").join(work_df, "resume_id")
    # 第一份工作经历
    first_work_df = resume_df.filter(
        resume_df.work_index == resume_df.work_len)

    parameters = [
        (["major"], "degree", ("major__position__relation", "position_name")),
    ]

    statistic_dimension(first_work_df, mysql_url, parameters,
                        statistic_number_dimension)
Beispiel #4
0
def statistic_neighbour(df, mysql_url):
    """
    当前职位(公司)的上(下)一份职位(公司)分布
    :param df: 
    :param mysql_url: 
    :return: 
    """

    parameters = [
        (["company_name"], "position_category", ("company__prev_company",
                                                 "prev_company")),
        (["company_name"], "position_category", ("company__next_company",
                                                 "next_company")),
        (["position_name"], "address", ("position__address__prev_position",
                                        "prev_position")),
        (["position_name"], "address", ("position__address__next_position",
                                        "next_position")),
    ]

    statistic_dimension(df, mysql_url, parameters,
                        statistic_neighbour_dimension)

    statistic_neighbour_special(df, mysql_url)
Beispiel #5
0
def statistic_rank(df, mysql_url):
    """
    排名相关分析
    :param df:
    :param mysql_url:
    :return:
    """

    parameters = [
        (["major"], "degree", ("major__rank", None)),
        (["school_name"], "degree", ("school__rank", None)),
        (["school_name", "major"], "degree", ("school__major__rank", None, True, True)),
        (["school_name", "major"], "degree",
         ("school__major__position__rank", "position_name", True, True, '-person_num', True)),
        (["company_name"], None, ("company__rank", None)),
        (["industry"], None, ("industry__rank", None),),
        (["industry"], "address", ("industry__address__rank", None)),
        (["position_name"], None, ("position__rank", None)),
        (["position_name"], None, ("position__industry__rank", "industry", True, False, '-person_num',)),

        (["position_name"], "address", ("position__address__industry", "industry", False, True, '-person_num')),
    ]

    statistic_dimension(df, mysql_url, parameters, statistic_rank_dimension)