service.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:intellead-classification 作者: intellead 项目源码 文件源码
def get_dataset_input_from_database(fields):
    rows = [];
    try:
        conn = get_connection()
        cur = conn.cursor()
        if 'main_activity' in fields:
            cur.execute('SELECT job_title, lead_profile, conversions, area, number_employees, segment, work_in_progress, source_first_conversion, source_last_conversion, concern, looking_for_management_software, cnae FROM dataset')
        else:
            cur.execute('SELECT job_title, lead_profile, conversions, area, number_employees, segment, work_in_progress, source_first_conversion, source_last_conversion, concern, looking_for_management_software FROM dataset')
        rows = cur.fetchall()
        cur.close()
    except (Exception, psycopg2.DatabaseError) as error:
        print(error)
    finally:
        if conn is not None:
            conn.close()
            return np.array(rows)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号