Trees | Indices | Help |
---|
|
misc.py defines several useful functions that don't rightly belong in any obvious location Functions --------- curry -- Curry a function, returning a callable with the value of the initial parameters pre-selected. One of the mainstays of functional programming. printExc -- Print a formatted stack-trace to standard error loadCSV -- Load a CSV file into a list of lists inlineCSV -- Similar to loadCSV, but takes the CSV text from a multiline python string
|
|||
|
|||
|
|||
|
|||
|
|
Curry a function, returning a callable with the value of the initial parameters pre-selected. For any function f curry(f,*arg0)(*arg1,**kw) f(x,*(arg0+arg1),**kw) so, for example: f(x,y) = curry(f,x)(y) = curry(f,x,y)() |
Load a CSV file into a list of lists, converting empty cells into None, numbers as floats and quoted strings as strings. In addition to standard CSV format, empty (white only) lines and lines starting with "#" are ignored |
Similar to loadCSV, but takes the CSV text from a multiline python string, e.g. >>> sheet = inlineCSV(''' ... # Non-CSV Unix shell style comments and empty lines are ignored ... , "sparrow", "banana" ... "weight", 5, 1 ... ''') |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jan 4 16:46:17 2018 | http://epydoc.sourceforge.net |