Files
founding-potential/extraction/non_founders_scripts.ipynb
2023-03-15 14:31:15 +01:00

244 KiB

In [1]:
import dimcli
from dimcli.utils import *

import sys, json, time
import pandas as pd
import numpy as np
from tqdm import tqdm

from tqdm.notebook import tqdm as progressbar

pd.set_option('display.max_columns', None)
In [2]:
import warnings
warnings.filterwarnings("ignore")
In [3]:
dsl = dimcli.login()
Searching config file credentials for default 'live' instance..
Dimcli - Dimensions API Client (v0.9.9)
Connected to: <https://app.dimensions.ai/api/dsl/v2> - DSL v2.5
Method: dsl.ini file
====
Heads up! The latest Dimcli version is  0.9.9.1
You have installed:  0.9.9
====
Please upgrade: `pip install dimcli -U`
In [4]:
dsl = dimcli.Dsl()
In [5]:
# GRIDID = "grid.6936.a"
In [5]:
# df_researchers = pd.read_csv(r"H:\\temp Uni\\baseline\\tumuenchen_nonfounders_temp700.csv")
df_researchers = pd.read_csv("toronto_nonfounders_temp1100.csv")
df_pubs = pd.read_csv("toronto_nonfounders_papers_0.csv")
df_pubs_authors = pd.read_csv("toronto_nonfounders_authors_0.csv")
df_pubs_authors_aff = pd.read_csv("toronto_nonfounders_authors_affiliations_0.csv")
df_pats = pd.read_csv("toronto_nonfounders_patents.csv")
df_grants = pd.read_csv("toronto_nonfounders_grants.csv")
In [6]:
df_pubs_0 = pd.read_csv("toronto_nonfounders_papers_1.csv")
df_pubs_authors_0 = pd.read_csv("toronto_nonfounders_authors_1.csv")
df_pubs_authors_aff_0 = pd.read_csv("toronto_nonfounders_authors_affiliations_1.csv")
In [7]:
df_pubs = df_pubs.append(df_pubs_0).reset_index(drop=True)
df_pubs_authors = df_pubs_authors.append(df_pubs_authors_0).reset_index(drop=True)
df_pubs_authors_aff = df_pubs_authors_aff.append(df_pubs_authors_aff_0).reset_index(drop=True)
In [22]:
df_researchers.shape
Out [22]:
(1099, 24)
In [23]:
len(list(set(df_pubs["author_people"].tolist() +  df_pats["author_people"].tolist())))
Out [23]:
919
In [11]:
df_pubs['times_cited'] = df_pubs['times_cited'].fillna(0)
df_pats['times_cited'] = df_pats['times_cited'].fillna(0)

# df_startups["founded_year"] = pd.DatetimeIndex(df_startups["founded_on"]).year.astype('Int64')

# df_startups['founded_year'] = df_startups['founded_year'].fillna(0)

df_researchers["full_name"] = df_researchers["first_name"] + " "+  df_researchers["last_name"]
df_pubs_authors["full_name"] = df_pubs_authors["first_name"] + " "+  df_pubs_authors["last_name"]
df_pubs_authors_aff["full_name"] = df_pubs_authors_aff["first_name"] + " "+  df_pubs_authors_aff["last_name"]

all_authors = list(set(df_pubs["author_people"].tolist() +  df_pats["author_people"].tolist()))

df_pubs["category_for"]= df_pubs["category_for"].replace({'\'': '"'}, regex=True)
df_pats["category_for"]= df_pats["category_for"].replace({'\'': '"'}, regex=True)
df_grants["category_for"]= df_grants["category_for"].replace({'\'': '"'}, regex=True)

df_pubs["research_area"] = df_pubs["category_for"].apply(lambda x: 'n.a.' if pd.isnull(x) else json.loads(x)[0]["name"])
df_pats["research_area"] = df_pats["category_for"].apply(lambda x: 'n.a.' if pd.isnull(x) else json.loads(x)[0]["name"])
df_grants["research_area"] = df_grants["category_for"].apply(lambda x: 'n.a.' if pd.isnull(x) else json.loads(x)[0]["name"])
In [ ]:
#df_pubs[df_pubs["author_people"] == "Eran Segal"].groupby("year")["year"].count().reset_index(name="count").sort_values(["count"],ascending=False)
In [ ]:
df_pubs_authors_aff[df_pubs_authors_aff["full_name"] == "Tomer Aharon"].groupby(["aff_id","aff_name","aff_country"])["aff_id"].count().reset_index(name="count").sort_values(["count"],ascending=False)
In [ ]:
pubs_ids = df_pubs_authors_aff[df_pubs_authors_aff["full_name"] == "Eran Segal"]["pub_id"].unique().tolist()
countries = df_pubs_authors_aff[df_pubs_authors_aff["full_name"] == "Eran Segal"]["aff_country"].unique().tolist()
collab_institutes = df_pubs_authors_aff[df_pubs_authors_aff["pub_id"].isin(pubs_ids) & ~(df_pubs_authors_aff["full_name"] == "Eran Segal")].groupby(["aff_id","aff_name","aff_country"])["aff_id"].count().reset_index(name="count").sort_values(["count"],ascending=False) #collab institutes
collab_institutes["count"].sum() #number of collab partners
In [8]:
def generate_history(grouped_df, field, founded_year, history_type, nonstartup):
    year_history = dict()
    ground_value = 0
    ground_year_string = "FN"
    # if founded_year == 0:
    #     return   
    if nonstartup:
        founded_year = 0
    for i in range(20):
        data = dict()
        positiv = founded_year + (i+1)
        literal = ground_year_string + "+"+ str(i+1)
        df_positiv = grouped_df[grouped_df[field] == positiv]
        key = "hist_{0}_{1}".format(history_type,literal)
        if df_positiv.shape[0] > 0:
            val = df_positiv["count"].values[0]
            data[key] = int(val)
            year_history.update(data) 
        else:
            data[key] = int(ground_value)
            year_history.update(data) 
        
    
    for i in range(20):
        data = dict()    
        negative = founded_year - (i+1)
        literal = ground_year_string + "-" + str(i+1)
        df_negative = grouped_df[grouped_df[field] == negative]
        key = "hist_{0}_{1}".format(history_type,literal)
        if df_negative.shape[0] > 0:
            val = df_negative["count"].values[0]
            data[key] = int(val)
            year_history.update(data) 
        else:
            data[key] = int(ground_value)
            year_history.update(data) 
            
    df_ground = grouped_df[grouped_df[field] == founded_year]
    key = "hist_{0}_{1}".format(history_type,ground_year_string)
    data = dict() 
    if df_ground.shape[0] > 0:
        val = df_ground["count"].values[0]
        data[key] = int(val)
        year_history.update(data)
    else:           
        data[key] = int(ground_value)
        year_history.update(data) 
    #year_history = dict(sorted(year_history.items())) 
    return year_history    
In [9]:
def the_H_function(sorted_citations_list, n=1):
    if sorted_citations_list and sorted_citations_list[0] >= n:
        return the_H_function(sorted_citations_list[1:], n+1)
    else:
        return n-1 
    
    
def the_i_10_function(sorted_citations_list):
    count = sum(map(lambda x : x>=10, sorted_citations_list))
    return count


def get_researcher_info(researcher_ids):
    #check if ids exist, if not use the info with names
    # if ids exist get the info plus affiliations using ids
    ids = json.dumps(researcher_ids)
    researchers = dsl.query_iterative(f"""search researchers
                                    where id in {ids}
                                    return researchers[first_name+last_name+first_publication_year+last_publication_year+research_orgs+total_grants+total_publications+id+last_grant_year+first_grant_year]""", show_results=False, pause=3)
    return researchers.as_dataframe()


def get_startup_info(researchers_df, author):
    name = list(researchers_df[researchers_df["full_name"] == author]["full_name"])[0]
    company = None
    founded_date = 0
    company_details = None
    startup_info = {
        "name": name,
        "company": company,
        "company_details": company_details,
        "founded_on":  founded_date,
    }
    return startup_info    

def get_affiliation_info(affiliation_df, author):
    total_affiliations = 0
    affiliations = affiliation_df[affiliation_df["full_name"] == author].groupby(["aff_id","aff_name","aff_country"])["aff_id"].count().reset_index(name="count").sort_values(["count"],ascending=False)
    if affiliations.shape[0] > 0:
        total_affiliations = affiliations.shape[0]
    affiliation_info = {
        "affiliations": total_affiliations
    }
    return affiliation_info   
        

def get_grants_info(grants_df, author, founded_year):
    first_grant_year = 0
    last_grant_year = 0
    number_grants = 0
    grant_research_area = None

    number_grants = grants_df[grants_df["author_people"] == author].shape[0]
    
    grant_by_year = grants_df[grants_df["author_people"] == author].groupby("start_year")["start_year"].count().reset_index(name="count").sort_values(["start_year"],ascending=True)        
    if grant_by_year.shape[0] > 0:
        first_grant_year = int(grant_by_year.iloc[0:]["start_year"].values[0])
        last_grant_year = int(grant_by_year.iloc[-1:]["start_year"].values[0])
    history_obj = generate_history(grant_by_year,"start_year",founded_year,"grant", True)    
    
    
    research_areas = list(grants_df[grants_df["author_people"] == author]["research_area"])
    if len(research_areas) > 0:
        grant_research_area = research_areas[0]   
    
    grant_info = {
        "first_grant_year": first_grant_year,
        "last_grant_year": last_grant_year,
        "grant_research_area": grant_research_area,
        "grants": number_grants
    }
    grant_info.update(history_obj)
    return grant_info

def get_publications_info(publications_df, author, founded_year):
    pub_citation_mean = 0
    pub_citation_sum = 0
    first_publication_year = 0
    last_publication_year = 0
    number_pubs = 0
    research_area = None
    
    citations_list = list(publications_df[publications_df["author_people"] == author]["times_cited"])
    citations_list.sort(reverse=True)
    h_index = the_H_function(citations_list)
    i10_index = the_i_10_function(citations_list)
    number_pubs = publications_df[publications_df["author_people"] == author].shape[0]
    
    if number_pubs > 0:
        pub_citation_mean = np.round(publications_df[publications_df["author_people"] == author]["times_cited"].mean(),2)
        pub_citation_sum = sum(citations_list)        
        
    pubs_by_year = publications_df[publications_df["author_people"] == author].groupby("year")["year"].count().reset_index(name="count").sort_values(["year"],ascending=True)        
    if pubs_by_year.shape[0] > 0:
        first_publication_year = int(pubs_by_year.iloc[0:]["year"].values[0])
        last_publication_year = int(pubs_by_year.iloc[-1:]["year"].values[0])
    history_obj = generate_history(pubs_by_year,"year",founded_year,"pub", True)    
    
    research_areas = list(publications_df[publications_df["author_people"] == author]["research_area"])
    if len(research_areas) > 0:
        research_area = research_areas[0]
        
    BATCHSIZE = 500
    VERBOSE = False
    patents_json = []

    q = """search patents
        where publication_ids in {}
        return patents[basics+publication_ids+category_for]"""

    pub_ids_list = list(df_pubs[df_pubs["author_people"] == author]["id"])

    try: 
        for chunk in list(chunks_of(pub_ids_list, BATCHSIZE)):
            data = dsl.query_iterative(q.format(json.dumps(chunk)), verbose=VERBOSE)
            patents_json += data.patents
            time.sleep(5)

        patents = pd.DataFrame().from_dict(patents_json)
        patents.drop_duplicates(subset='id', inplace=True)
        linked_patents_to_publications = len(patents)
        # print("Patents found: ", len(patents)) 
    except Exception as e:
        print("failed on", author)
        linked_patents_to_publications = -1
                   
    
    publication_info = {
        "h-index": h_index,
        "i10-index": i10_index,
        "publications": number_pubs,
        "pub_citation_mean": pub_citation_mean,
        "pub_citation_sum": pub_citation_sum,
        "first_publication_year": first_publication_year,
        "last_publication_year": last_publication_year,
        "publication_research_area": research_area,
        "linked_patents_to_publications": linked_patents_to_publications
    }
    publication_info.update(history_obj)
    return publication_info

def get_patent_info(patents_df, author, founded_year):
    pat_citation_mean = 0
    pat_citation_sum = 0
    first_patent_year = 0
    last_patent_year = 0
    number_pats = 0
    patent_research_area = None
    
    citations_list_pats = list(patents_df[patents_df["author_people"] == author]["times_cited"])
    number_pats = patents_df[patents_df["author_people"] == author].shape[0]
    
    if number_pats > 0:
        pat_citation_mean = np.round(patents_df[patents_df["author_people"] == author]["times_cited"].mean(),2) 
        pat_citation_sum = sum(citations_list_pats)    
        
    pats_by_year = patents_df[patents_df["author_people"] == author].groupby("year")["year"].count().reset_index(name="count").sort_values(["year"],ascending=True)        
    if pats_by_year.shape[0] > 0:
        first_patent_year = int(pats_by_year.iloc[0:]["year"].values[0])
        last_patent_year = int(pats_by_year.iloc[-1:]["year"].values[0])
    history_obj = generate_history(pats_by_year,"year",founded_year,"pat", True)    
        
    patent_research_areas = list(patents_df[patents_df["author_people"] == author]["research_area"])
    if len(patent_research_areas) > 0:
        patent_research_area = patent_research_areas[0]      
    
    patent_info = {
        "patents": number_pats,
        "pat_citation_mean": pat_citation_mean,
        "pat_citation_sum": pat_citation_sum,
        "first_patent_year": first_patent_year,
        "last_patent_year": last_patent_year,
        "patent_research_area": patent_research_area
    }
    patent_info.update(history_obj)
    return patent_info
In [ ]:
# BATCHSIZE = 400
# VERBOSE = False
# patents_json = []

# q = """search patents
# where publication_ids in {}
# return patents[basics+publication_ids+category_for]"""

# pub_ids_list = list(df_pubs[df_pubs["author_people"] == "Aviv Madar"]["id"])

# for chunk in progressbar(list(chunks_of(pub_ids_list, 400))):
#     data = dsl.query_iterative(q.format(json.dumps(chunk)), verbose=VERBOSE)
#     patents_json += data.patents
#     time.sleep(3)

# patents = pd.DataFrame().from_dict(patents_json)
# patents.drop_duplicates(subset='id', inplace=True)
# referenced_pubs_in_patents = len(patents)
In [ ]:
# def count_patents_per_pub(pubid):
#   global patents
#   return len(patents[patents['publication_ids'].str.contains(pubid)])

# # turn lists into strings to ensure compatibility with CSV loaded data
# # see also: https://stackoverflow.com/questions/23111990/pandas-dataframe-stored-list-as-string-how-to-convert-back-to-list
# patents['publication_ids'] = patents['publication_ids'].apply(lambda x: ','.join(map(str, x)))

# #progressbar.pandas()
# #pubs['patents'] = pubs['id'].progress_apply(lambda x: count_patents_per_pub(x))
In [12]:
# columns= ["name","company","founded_on", "company_details","h-index","i10-index","publications", "patents", "pub_citation_mean", "pat_citation_mean", "pub_citation_sum", "pat_citation_sum",
#           "first_publication_year", "first_grant_year", "first_patent_year", "last_publication_year", "last_grant_year", "last_patent_year", "affiliations", "research_area"]
features_df = pd.DataFrame()
for author in tqdm(all_authors):
    row = dict()
    # print(author)
    startup_info = get_startup_info(df_researchers, author)
    founded_year = startup_info["founded_on"]
    publication_info = get_publications_info(df_pubs, author, founded_year)
    patent_info = get_patent_info(df_pats, author, founded_year)
    grant_info = get_grants_info(df_grants, author, founded_year)
    affiliation_info = get_affiliation_info(df_pubs_authors_aff, author)
    
    row.update(startup_info)
    row.update(publication_info)
    row.update(patent_info)
    row.update(grant_info)
    row.update(affiliation_info)
    features_df = features_df.append(row, ignore_index=True)
    
    
    # df_temp = df_pubs_authors[df_pubs_authors["full_name"]== author].copy()
    # if df_temp.shape[0] > 0:
    #     df_temp = df_temp.dropna(subset=["researcher_id"]) 
    #     df_temp.drop_duplicates('researcher_id', inplace=True)
    #     researcher_ids = df_temp["researcher_id"].unique().tolist()
 32%|███▏      | 292/919 [1:11:35<1:39:31,  9.52s/it] 
failed on Wei Wang
 32%|███▏      | 297/919 [1:26:21<12:31:31, 72.49s/it] 
failed on Christopher Mark Overall
 39%|███▉      | 358/919 [1:44:53<2:59:12, 19.17s/it] 
failed on Angela Cox
100%|██████████| 919/919 [3:24:34<00:00, 13.36s/it]    
In [13]:
features_df
Out [13]:
name company company_details founded_on h-index i10-index publications pub_citation_mean pub_citation_sum first_publication_year last_publication_year publication_research_area linked_patents_to_publications hist_pub_FN+1 hist_pub_FN+2 hist_pub_FN+3 hist_pub_FN+4 hist_pub_FN+5 hist_pub_FN+6 hist_pub_FN+7 hist_pub_FN+8 hist_pub_FN+9 hist_pub_FN+10 hist_pub_FN+11 hist_pub_FN+12 hist_pub_FN+13 hist_pub_FN+14 hist_pub_FN+15 hist_pub_FN+16 hist_pub_FN+17 hist_pub_FN+18 hist_pub_FN+19 hist_pub_FN+20 hist_pub_FN-1 hist_pub_FN-2 hist_pub_FN-3 hist_pub_FN-4 hist_pub_FN-5 hist_pub_FN-6 hist_pub_FN-7 hist_pub_FN-8 hist_pub_FN-9 hist_pub_FN-10 hist_pub_FN-11 hist_pub_FN-12 hist_pub_FN-13 hist_pub_FN-14 hist_pub_FN-15 hist_pub_FN-16 hist_pub_FN-17 hist_pub_FN-18 hist_pub_FN-19 hist_pub_FN-20 hist_pub_FN patents pat_citation_mean pat_citation_sum first_patent_year last_patent_year patent_research_area hist_pat_FN+1 hist_pat_FN+2 hist_pat_FN+3 hist_pat_FN+4 hist_pat_FN+5 hist_pat_FN+6 hist_pat_FN+7 hist_pat_FN+8 hist_pat_FN+9 hist_pat_FN+10 hist_pat_FN+11 hist_pat_FN+12 hist_pat_FN+13 hist_pat_FN+14 hist_pat_FN+15 hist_pat_FN+16 hist_pat_FN+17 hist_pat_FN+18 hist_pat_FN+19 hist_pat_FN+20 hist_pat_FN-1 hist_pat_FN-2 hist_pat_FN-3 hist_pat_FN-4 hist_pat_FN-5 hist_pat_FN-6 hist_pat_FN-7 hist_pat_FN-8 hist_pat_FN-9 hist_pat_FN-10 hist_pat_FN-11 hist_pat_FN-12 hist_pat_FN-13 hist_pat_FN-14 hist_pat_FN-15 hist_pat_FN-16 hist_pat_FN-17 hist_pat_FN-18 hist_pat_FN-19 hist_pat_FN-20 hist_pat_FN first_grant_year last_grant_year grant_research_area grants hist_grant_FN+1 hist_grant_FN+2 hist_grant_FN+3 hist_grant_FN+4 hist_grant_FN+5 hist_grant_FN+6 hist_grant_FN+7 hist_grant_FN+8 hist_grant_FN+9 hist_grant_FN+10 hist_grant_FN+11 hist_grant_FN+12 hist_grant_FN+13 hist_grant_FN+14 hist_grant_FN+15 hist_grant_FN+16 hist_grant_FN+17 hist_grant_FN+18 hist_grant_FN+19 hist_grant_FN+20 hist_grant_FN-1 hist_grant_FN-2 hist_grant_FN-3 hist_grant_FN-4 hist_grant_FN-5 hist_grant_FN-6 hist_grant_FN-7 hist_grant_FN-8 hist_grant_FN-9 hist_grant_FN-10 hist_grant_FN-11 hist_grant_FN-12 hist_grant_FN-13 hist_grant_FN-14 hist_grant_FN-15 hist_grant_FN-16 hist_grant_FN-17 hist_grant_FN-18 hist_grant_FN-19 hist_grant_FN-20 hist_grant_FN affiliations
0 Sarah Watt None None 0 21 42 147 12.33 1812 2002 2022 3404 Medicinal and Biomolecular Chemistry 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13
1 Jacob W Koudys None None 0 3 2 4 7.00 28 2018 2021 52 Psychology 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 Oyedele Adewale Adeyi None None 0 2 1 2 12.00 24 2010 2020 32 Biomedical and Clinical Sciences 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3
3 Majid Y Moridani None None 0 19 30 36 36.19 1303 2001 2015 3101 Biochemistry and Cell Biology 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2007 2007 32 Biomedical and Clinical Sciences 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4
4 Noa Gilad None None 0 2 1 4 27.50 110 2011 2021 3215 Reproductive Medicine 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
914 Tore Kristian Kvien None None 0 16 22 45 18.80 846 1981 2022 32 Biomedical and Clinical Sciences 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1999 2021 32 Biomedical and Clinical Sciences 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7
915 Jean-William P Laliberté None None 0 2 1 5 9.60 48 2018 2022 n.a. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2016 2021 44 Human Society 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
916 Anthony James Gill None None 0 1 0 2 4.50 9 1999 2016 32 Biomedical and Clinical Sciences 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2
917 William M Mihalko None None 0 34 86 206 18.10 3729 1988 2023 40 Engineering 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2018 2018 32 Biomedical and Clinical Sciences 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8
918 Ashutosh D Wechalekar None None 0 47 88 203 46.96 9533 2005 2022 32 Biomedical and Clinical Sciences 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12

919 rows × 147 columns

In [16]:
features_df[features_df["linked_patents_to_publications"]==-1]
Out [16]:
name company company_details founded_on h-index i10-index publications pub_citation_mean pub_citation_sum first_publication_year last_publication_year publication_research_area linked_patents_to_publications hist_pub_FN+1 hist_pub_FN+2 hist_pub_FN+3 hist_pub_FN+4 hist_pub_FN+5 hist_pub_FN+6 hist_pub_FN+7 hist_pub_FN+8 hist_pub_FN+9 hist_pub_FN+10 hist_pub_FN+11 hist_pub_FN+12 hist_pub_FN+13 hist_pub_FN+14 hist_pub_FN+15 hist_pub_FN+16 hist_pub_FN+17 hist_pub_FN+18 hist_pub_FN+19 hist_pub_FN+20 hist_pub_FN-1 hist_pub_FN-2 hist_pub_FN-3 hist_pub_FN-4 hist_pub_FN-5 hist_pub_FN-6 hist_pub_FN-7 hist_pub_FN-8 hist_pub_FN-9 hist_pub_FN-10 hist_pub_FN-11 hist_pub_FN-12 hist_pub_FN-13 hist_pub_FN-14 hist_pub_FN-15 hist_pub_FN-16 hist_pub_FN-17 hist_pub_FN-18 hist_pub_FN-19 hist_pub_FN-20 hist_pub_FN patents pat_citation_mean pat_citation_sum first_patent_year last_patent_year patent_research_area hist_pat_FN+1 hist_pat_FN+2 hist_pat_FN+3 hist_pat_FN+4 hist_pat_FN+5 hist_pat_FN+6 hist_pat_FN+7 hist_pat_FN+8 hist_pat_FN+9 hist_pat_FN+10 hist_pat_FN+11 hist_pat_FN+12 hist_pat_FN+13 hist_pat_FN+14 hist_pat_FN+15 hist_pat_FN+16 hist_pat_FN+17 hist_pat_FN+18 hist_pat_FN+19 hist_pat_FN+20 hist_pat_FN-1 hist_pat_FN-2 hist_pat_FN-3 hist_pat_FN-4 hist_pat_FN-5 hist_pat_FN-6 hist_pat_FN-7 hist_pat_FN-8 hist_pat_FN-9 hist_pat_FN-10 hist_pat_FN-11 hist_pat_FN-12 hist_pat_FN-13 hist_pat_FN-14 hist_pat_FN-15 hist_pat_FN-16 hist_pat_FN-17 hist_pat_FN-18 hist_pat_FN-19 hist_pat_FN-20 hist_pat_FN first_grant_year last_grant_year grant_research_area grants hist_grant_FN+1 hist_grant_FN+2 hist_grant_FN+3 hist_grant_FN+4 hist_grant_FN+5 hist_grant_FN+6 hist_grant_FN+7 hist_grant_FN+8 hist_grant_FN+9 hist_grant_FN+10 hist_grant_FN+11 hist_grant_FN+12 hist_grant_FN+13 hist_grant_FN+14 hist_grant_FN+15 hist_grant_FN+16 hist_grant_FN+17 hist_grant_FN+18 hist_grant_FN+19 hist_grant_FN+20 hist_grant_FN-1 hist_grant_FN-2 hist_grant_FN-3 hist_grant_FN-4 hist_grant_FN-5 hist_grant_FN-6 hist_grant_FN-7 hist_grant_FN-8 hist_grant_FN-9 hist_grant_FN-10 hist_grant_FN-11 hist_grant_FN-12 hist_grant_FN-13 hist_grant_FN-14 hist_grant_FN-15 hist_grant_FN-16 hist_grant_FN-17 hist_grant_FN-18 hist_grant_FN-19 hist_grant_FN-20 hist_grant_FN affiliations
In [15]:
features_df = features_df[features_df["linked_patents_to_publications"]!=-1]
In [46]:
len(list(df_pubs[df_pubs["author_people"] == "Giulia Montori"]["id"]))
Out [46]:
86
In [47]:
BATCHSIZE = 500
VERBOSE = True
patents_json = []

q = """search patents
    where publication_ids in {}
    return patents[basics+publication_ids+category_for]"""

pub_ids_list = list(df_pubs[df_pubs["author_people"] == "Giulia Montori"]["id"])

for chunk in list(chunks_of(pub_ids_list, BATCHSIZE)):
    data = dsl.query_iterative(q.format(json.dumps(chunk)), verbose=VERBOSE)
    patents_json += data.patents
    time.sleep(5)

patents = pd.DataFrame().from_dict(patents_json)
patents.drop_duplicates(subset='id', inplace=True)
linked_patents_to_publications = len(patents)
Starting iteration with limit=1000 skip=0 ...
===
Records extracted: 0
In [48]:
features_df.loc[features_df["name"]=="Giulia Montori", ["linked_patents_to_publications"]] = linked_patents_to_publications
In [49]:
features_df[features_df["name"]=="Giulia Montori"]
Out [49]:
name company company_details founded_on h-index i10-index publications pub_citation_mean pub_citation_sum first_publication_year last_publication_year publication_research_area linked_patents_to_publications hist_pub_FN+1 hist_pub_FN+2 hist_pub_FN+3 hist_pub_FN+4 hist_pub_FN+5 hist_pub_FN+6 hist_pub_FN+7 hist_pub_FN+8 hist_pub_FN+9 hist_pub_FN+10 hist_pub_FN+11 hist_pub_FN+12 hist_pub_FN+13 hist_pub_FN+14 hist_pub_FN+15 hist_pub_FN+16 hist_pub_FN+17 hist_pub_FN+18 hist_pub_FN+19 hist_pub_FN+20 hist_pub_FN-1 hist_pub_FN-2 hist_pub_FN-3 hist_pub_FN-4 hist_pub_FN-5 hist_pub_FN-6 hist_pub_FN-7 hist_pub_FN-8 hist_pub_FN-9 hist_pub_FN-10 hist_pub_FN-11 hist_pub_FN-12 hist_pub_FN-13 hist_pub_FN-14 hist_pub_FN-15 hist_pub_FN-16 hist_pub_FN-17 hist_pub_FN-18 hist_pub_FN-19 hist_pub_FN-20 hist_pub_FN patents pat_citation_mean pat_citation_sum first_patent_year last_patent_year patent_research_area hist_pat_FN+1 hist_pat_FN+2 hist_pat_FN+3 hist_pat_FN+4 hist_pat_FN+5 hist_pat_FN+6 hist_pat_FN+7 hist_pat_FN+8 hist_pat_FN+9 hist_pat_FN+10 hist_pat_FN+11 hist_pat_FN+12 hist_pat_FN+13 hist_pat_FN+14 hist_pat_FN+15 hist_pat_FN+16 hist_pat_FN+17 hist_pat_FN+18 hist_pat_FN+19 hist_pat_FN+20 hist_pat_FN-1 hist_pat_FN-2 hist_pat_FN-3 hist_pat_FN-4 hist_pat_FN-5 hist_pat_FN-6 hist_pat_FN-7 hist_pat_FN-8 hist_pat_FN-9 hist_pat_FN-10 hist_pat_FN-11 hist_pat_FN-12 hist_pat_FN-13 hist_pat_FN-14 hist_pat_FN-15 hist_pat_FN-16 hist_pat_FN-17 hist_pat_FN-18 hist_pat_FN-19 hist_pat_FN-20 hist_pat_FN first_grant_year last_grant_year grant_research_area grants hist_grant_FN+1 hist_grant_FN+2 hist_grant_FN+3 hist_grant_FN+4 hist_grant_FN+5 hist_grant_FN+6 hist_grant_FN+7 hist_grant_FN+8 hist_grant_FN+9 hist_grant_FN+10 hist_grant_FN+11 hist_grant_FN+12 hist_grant_FN+13 hist_grant_FN+14 hist_grant_FN+15 hist_grant_FN+16 hist_grant_FN+17 hist_grant_FN+18 hist_grant_FN+19 hist_grant_FN+20 hist_grant_FN-1 hist_grant_FN-2 hist_grant_FN-3 hist_grant_FN-4 hist_grant_FN-5 hist_grant_FN-6 hist_grant_FN-7 hist_grant_FN-8 hist_grant_FN-9 hist_grant_FN-10 hist_grant_FN-11 hist_grant_FN-12 hist_grant_FN-13 hist_grant_FN-14 hist_grant_FN-15 hist_grant_FN-16 hist_grant_FN-17 hist_grant_FN-18 hist_grant_FN-19 hist_grant_FN-20 hist_grant_FN affiliations
1290 Giulia Montori None None 0 25 36 86 29.29 2519 2011 2022 32 Biomedical and Clinical Sciences 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
In [18]:
features_df["founded_on"] = features_df["founded_on"].astype(int)
features_df["first_publication_year"] = features_df["first_publication_year"].astype(int)
features_df["last_publication_year"] = features_df["last_publication_year"].astype(int)
features_df["first_patent_year"] = features_df["first_patent_year"].astype(int)
features_df["last_patent_year"] = features_df["last_patent_year"].astype(int)
features_df["publications"] = features_df["publications"].astype(int)
features_df["patents"] = features_df["patents"].astype(int)
features_df["affiliations"] = features_df["affiliations"].astype(int)
features_df["grants"] = features_df["grants"].astype(int)
features_df["first_grant_year"] = features_df["first_grant_year"].astype(int)
features_df["last_grant_year"] = features_df["last_grant_year"].astype(int)
features_df["linked_patents_to_publications"] = features_df["linked_patents_to_publications"].astype(int)

cols = [col for col in features_df if col.startswith('hist_')]
features_df[cols] = features_df[cols].astype(int)

features_df["Company_founded"] = 0
In [19]:
features_df
Out [19]:
name company company_details founded_on h-index i10-index publications pub_citation_mean pub_citation_sum first_publication_year last_publication_year publication_research_area linked_patents_to_publications hist_pub_FN+1 hist_pub_FN+2 hist_pub_FN+3 hist_pub_FN+4 hist_pub_FN+5 hist_pub_FN+6 hist_pub_FN+7 hist_pub_FN+8 hist_pub_FN+9 hist_pub_FN+10 hist_pub_FN+11 hist_pub_FN+12 hist_pub_FN+13 hist_pub_FN+14 hist_pub_FN+15 hist_pub_FN+16 hist_pub_FN+17 hist_pub_FN+18 hist_pub_FN+19 hist_pub_FN+20 hist_pub_FN-1 hist_pub_FN-2 hist_pub_FN-3 hist_pub_FN-4 hist_pub_FN-5 hist_pub_FN-6 hist_pub_FN-7 hist_pub_FN-8 hist_pub_FN-9 hist_pub_FN-10 hist_pub_FN-11 hist_pub_FN-12 hist_pub_FN-13 hist_pub_FN-14 hist_pub_FN-15 hist_pub_FN-16 hist_pub_FN-17 hist_pub_FN-18 hist_pub_FN-19 hist_pub_FN-20 hist_pub_FN patents pat_citation_mean pat_citation_sum first_patent_year last_patent_year patent_research_area hist_pat_FN+1 hist_pat_FN+2 hist_pat_FN+3 hist_pat_FN+4 hist_pat_FN+5 hist_pat_FN+6 hist_pat_FN+7 hist_pat_FN+8 hist_pat_FN+9 hist_pat_FN+10 hist_pat_FN+11 hist_pat_FN+12 hist_pat_FN+13 hist_pat_FN+14 hist_pat_FN+15 hist_pat_FN+16 hist_pat_FN+17 hist_pat_FN+18 hist_pat_FN+19 hist_pat_FN+20 hist_pat_FN-1 hist_pat_FN-2 hist_pat_FN-3 hist_pat_FN-4 hist_pat_FN-5 hist_pat_FN-6 hist_pat_FN-7 hist_pat_FN-8 hist_pat_FN-9 hist_pat_FN-10 hist_pat_FN-11 hist_pat_FN-12 hist_pat_FN-13 hist_pat_FN-14 hist_pat_FN-15 hist_pat_FN-16 hist_pat_FN-17 hist_pat_FN-18 hist_pat_FN-19 hist_pat_FN-20 hist_pat_FN first_grant_year last_grant_year grant_research_area grants hist_grant_FN+1 hist_grant_FN+2 hist_grant_FN+3 hist_grant_FN+4 hist_grant_FN+5 hist_grant_FN+6 hist_grant_FN+7 hist_grant_FN+8 hist_grant_FN+9 hist_grant_FN+10 hist_grant_FN+11 hist_grant_FN+12 hist_grant_FN+13 hist_grant_FN+14 hist_grant_FN+15 hist_grant_FN+16 hist_grant_FN+17 hist_grant_FN+18 hist_grant_FN+19 hist_grant_FN+20 hist_grant_FN-1 hist_grant_FN-2 hist_grant_FN-3 hist_grant_FN-4 hist_grant_FN-5 hist_grant_FN-6 hist_grant_FN-7 hist_grant_FN-8 hist_grant_FN-9 hist_grant_FN-10 hist_grant_FN-11 hist_grant_FN-12 hist_grant_FN-13 hist_grant_FN-14 hist_grant_FN-15 hist_grant_FN-16 hist_grant_FN-17 hist_grant_FN-18 hist_grant_FN-19 hist_grant_FN-20 hist_grant_FN affiliations Company_founded
0 Sarah Watt None None 0 21 42 147 12.33 1812 2002 2022 3404 Medicinal and Biomolecular Chemistry 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 0
1 Jacob W Koudys None None 0 3 2 4 7.00 28 2018 2021 52 Psychology 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 Oyedele Adewale Adeyi None None 0 2 1 2 12.00 24 2010 2020 32 Biomedical and Clinical Sciences 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0
3 Majid Y Moridani None None 0 19 30 36 36.19 1303 2001 2015 3101 Biochemistry and Cell Biology 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2007 2007 32 Biomedical and Clinical Sciences 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0
4 Noa Gilad None None 0 2 1 4 27.50 110 2011 2021 3215 Reproductive Medicine 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
914 Tore Kristian Kvien None None 0 16 22 45 18.80 846 1981 2022 32 Biomedical and Clinical Sciences 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1999 2021 32 Biomedical and Clinical Sciences 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0
915 Jean-William P Laliberté None None 0 2 1 5 9.60 48 2018 2022 n.a. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2016 2021 44 Human Society 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
916 Anthony James Gill None None 0 1 0 2 4.50 9 1999 2016 32 Biomedical and Clinical Sciences 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0
917 William M Mihalko None None 0 34 86 206 18.10 3729 1988 2023 40 Engineering 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2018 2018 32 Biomedical and Clinical Sciences 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 0
918 Ashutosh D Wechalekar None None 0 47 88 203 46.96 9533 2005 2022 32 Biomedical and Clinical Sciences 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 None 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 0

916 rows × 148 columns

In [20]:
features_df.to_csv("toronto_nonfounders_features_dataset.csv", index=False)
In [ ]:
#CATEGORY = "None"  #@param ['None', '0101 Pure Mathematics', '0102 Applied Mathematics', '0103 Numerical and Computational Mathematics', '0104 Statistics', '0105 Mathematical Physics', 
# '0201 Astronomical and Space Sciences', '0202 Atomic, Molecular, Nuclear, Particle and Plasma Physics', '0203 Classical Physics', '0204 Condensed Matter Physics', '0205 Optical Physics', 
# '0206 Quantum Physics', '0299 Other Physical Sciences', '0301 Analytical Chemistry', '0302 Inorganic Chemistry', '0303 Macromolecular and Materials Chemistry', '0304 Medicinal and Biomolecular Chemistry', 
# '0305 Organic Chemistry', '0306 Physical Chemistry (incl. Structural)', '0307 Theoretical and Computational Chemistry', '0399 Other Chemical Sciences', '0401 Atmospheric Sciences', '0402 Geochemistry', '0403 Geology', 
# '0404 Geophysics', '0405 Oceanography', '0406 Physical Geography and Environmental Geoscience', '0499 Other Earth Sciences', '0501 Ecological Applications', '0502 Environmental Science and Management', '0503 Soil Sciences', 
# '0599 Other Environmental Sciences', '0601 Biochemistry and Cell Biology', '0602 Ecology', '0603 Evolutionary Biology', '0604 Genetics', '0605 Microbiology', '0606 Physiology', '0607 Plant Biology', '0608 Zoology', 
# '0699 Other Biological Sciences', '0701 Agriculture, Land and Farm Management', '0702 Animal Production', '0703 Crop and Pasture Production', '0704 Fisheries Sciences', '0705 Forestry Sciences', '0706 Horticultural Production', 
# '0707 Veterinary Sciences', '0799 Other Agricultural and Veterinary Sciences', '0801 Artificial Intelligence and Image Processing', '0802 Computation Theory and Mathematics', '0803 Computer Software', '0804 Data Format', 
# '0805 Distributed Computing', '0806 Information Systems', '0807 Library and Information Studies', '0899 Other Information and Computing Sciences', '0901 Aerospace Engineering', '0902 Automotive Engineering', 
# '0903 Biomedical Engineering', '0904 Chemical Engineering', '0905 Civil Engineering', '0906 Electrical and Electronic Engineering', '0907 Environmental Engineering', '0908 Food Sciences', '0909 Geomatic Engineering', 
# '0910 Manufacturing Engineering', '0911 Maritime Engineering', '0912 Materials Engineering', '0913 Mechanical Engineering', '0914 Resources Engineering and Extractive Metallurgy', '0915 Interdisciplinary Engineering', 
# '0999 Other Engineering', '1001 Agricultural Biotechnology', '1002 Environmental Biotechnology', '1003 Industrial Biotechnology', '1004 Medical Biotechnology', '1005 Communications Technologies', '1006 Computer Hardware', 
# '1007 Nanotechnology', '1099 Other Technology', '1101 Medical Biochemistry and Metabolomics', '1102 Cardiorespiratory Medicine and Haematology', '1103 Clinical Sciences', '1104 Complementary and Alternative Medicine', 
# '1105 Dentistry', '1106 Human Movement and Sports Science', '1107 Immunology', '1108 Medical Microbiology', '1109 Neurosciences', '1110 Nursing', '1111 Nutrition and Dietetics', '1112 Oncology and Carcinogenesis', 
# '1113 Ophthalmology and Optometry', '1114 Paediatrics and Reproductive Medicine', '1115 Pharmacology and Pharmaceutical Sciences', '1116 Medical Physiology', '1117 Public Health and Health Services', 
# '1199 Other Medical and Health Sciences', '1201 Architecture', '1202 Building', '1203 Design Practice and Management', '1205 Urban and Regional Planning', '1299 Other Built Environment and Design', '1301 Education Systems', 
# '1302 Curriculum and Pedagogy', '1303 Specialist Studies In Education', '1399 Other Education', '1401 Economic Theory', '1402 Applied Economics', '1403 Econometrics', '1499 Other Economics', 
# '1501 Accounting, Auditing and Accountability', '1502 Banking, Finance and Investment', '1503 Business and Management', '1504 Commercial Services', '1505 Marketing', '1506 Tourism', 
# '1507 Transportation and Freight Services', '1601 Anthropology', '1602 Criminology', '1603 Demography', '1604 Human Geography', '1605 Policy and Administration', '1606 Political Science', '1607 Social Work', 
# '1608 Sociology', '1699 Other Studies In Human Society', '1701 Psychology', '1702 Cognitive Sciences', '1799 Other Psychology and Cognitive Sciences', '1801 Law', '1899 Other Law and Legal Studies', 
# '1901 Art Theory and Criticism', '1902 Film, Television and Digital Media', '1903 Journalism and Professional Writing', '1904 Performing Arts and Creative Writing', '1905 Visual Arts and Crafts', 
# '1999 Other Studies In Creative Arts and Writing', '2001 Communication and Media Studies', '2002 Cultural Studies', '2003 Language Studies', '2004 Linguistics', '2005 Literary Studies', 
# '2099 Other Language, Communication and Culture', '2101 Archaeology', '2102 Curatorial and Related Studies', '2103 Historical Studies', '2199 Other History and Archaeology', '2201 Applied Ethics', 
# '2202 History and Philosophy of Specific Fields', '2203 Philosophy', '2204 Religion and Religious Studies', '2299 Other Philosophy and Religious Studies']