LIAM 2 User Guide
LIAM 2 User Guide
LIAM 2 User Guide
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>LIAM</strong> 2 <strong>User</strong> <strong>Guide</strong>, Release 0.7.0csv([row1value1, ..., row1valueN],...[rowNvalue1, ..., rowNvalueN],fname=’several_rows.csv’)examplecsv([’this is’, ’a header’],[’with’, ’several lines’],fname=’person_age_aggregates.csv’)Will produce a file with a layout like this:| this is | a header || with | several lines |5.6.4 dumpdump produces a table with the expressions given as argument evaluated over many (possibly all) individuals ofthe dataset.general formatdump([expr1, expr2, ...,filter=filterexpression, missing=value, header=True])If no expression is given, all fields of the current entity will be dumped (including temporary variables availableat that point), otherwise, each expression will be evaluated on the objects which satisfy the filter and produce atable.The ‘filter’ argument allows to evaluate the expressions only on the individuals which satisfy the filter. Defaultsto None (evaluate on all individuals).The ‘missing’ argument can be used to transform ‘nan’ values to another value. Defaults to None (no transformation).The ‘header’ argument determine whether column names should be in the dump or not. Defaults to True.exampleshow(dump(age, partner.age, gender, filter=id < 10))givesid | age | partner.age | gender0 | 27 | -1 | False1 | 86 | 71 | False2 | 16 | -1 | True3 | 19 | -1 | False4 | 27 | 21 | False5 | 89 | 92 | True6 | 59 | 61 | True7 | 65 | 29 | False8 | 38 | 35 | True9 | 48 | 52 | True5.6.5 groupbygroupby (aka pivot table): group all individuals by their value for the given expressions, and optionally computean expression for each group (using the expr argument). If no expression is given, it will compute the number ofindividuals in that group. A filter can be specified to limit the individuals taken into account.5.6. Output 31