gendas package¶
Subpackages¶
Submodules¶
gendas.engine module¶
gendas.experimental module¶
gendas.sources module¶
gendas.statistics module¶
Basic statistic algorithms computed over an iterable collection without loading all the values into memory.
-
gendas.statistics.count(iterator)¶ Counts the length of an iterator iterating it
Parameters: iterator – An iterable collection Returns: How many elements you have in the iterator
-
gendas.statistics.empty(fn, values, default=None)¶ Returns ‘default’ value if ‘values’ list is empty. Otherwise calls ‘fn’ with the ‘values’ list.
Parameters: - fn – The function to call if the list is not empty
- values – Values to pass to the ‘fn’ function
- default – The value to return if the list is empty
Returns: ‘default’ if ‘values’ is empty, ‘fn(values)’ otherwise.
-
gendas.statistics.max(values)¶ Computes the maximum value
Parameters: values – An iterable collection Returns: The maximum value or None if values it’s empty
-
gendas.statistics.mean(values)¶ Computes the mean value
Parameters: values – An iterable collection Returns: The mean or None if values it’s empty
-
gendas.statistics.min(values)¶ Computes the minimum value
Parameters: values – An iterable collection Returns: The minimum value or None if values it’s empty
-
gendas.statistics.peek(iterable)¶ Get the first value of an iterator without iterating two times an iterator
Parameters: iterable – An iterable Returns: The first value and an iterator to iterate all the values included the first one.
gendas.utils module¶
Help functions used in several modules.
-
gendas.utils.flatten(iterable)¶ A generator that iterates a collection of nested lists as a single collection
Parameters: iterable – An iterable collection with nested lists