Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a85ededb authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

Defined generative and expandAlignment as categorical columns

parent 10b24b89
No related branches found
No related tags found
No related merge requests found
......@@ -25,12 +25,18 @@ def typeTableColumns( df ):
if 'ops' in df.columns:
df['ops'] = pd.Categorical(df['ops'], ["nothing", "delete", "replace", "refine", "add", "addjoin", "refadd"])
if 'str' in df.columns:
df['str'] = pd.Categorical(df['str'], ["strgen", "strspc", "strrdm"])
df['str'] = pd.Categorical(df['str'], ['_',"strgen", "strspc", "strrdm"])
if 'strenghen' in df.index.names:
df['strenthen'] = pd.Categorical(df['strenghen'], ["strgen", "strspc", "strrdm"])
# MAY BE USED TO NORMALIZE
#avg_tosv['generative'] = pd.Categorical(avg_tosv['generative'], ['_NOT_',1])
#avg_tosv['expandAlignments'] = pd.Categorical(avg_tosv['expandAlignments'], ['memory','clever','_NOT_'])
df['strenthen'] = pd.Categorical(df['strenghen'], ['_',"strgen", "strspc", "strrdm"])
# ??
if 'generative' in df.columns or 'generative' in df.index.names:
df['generative'] = pd.Categorical(df['generative'], ['_NOT_','_','1'])
if 'expandAlignments' in df.columns or 'expandAlignments' in df.index.names:
df['expandAlignments'] = pd.Categorical(df['expandAlignments'], ['_','_NOT_','memory','clever'])
# Better keep these as strings...
#if 'immediateRatio' in df.columns or 'immediateRatio' in df.index.names:
# df.replace({'immediateRatio':{'_':'0'}}, inplace = True)
# df['immediateRatio'] = df['immediateRatio'].astype(float)
###### STRIPPING COLUMNS
......
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