This module contains helper functions for using in various interpretation classes for Pavel's interpretation modules

class Interpret[source]

Interpret(learn, df)

sv_var[source]

sv_var(var, name, path, bzipped=False)

Save variable as pickle object to path with name

ld_var[source]

ld_var(name, path, bzipped=False)

Returns a pickle object from path with name

list_diff[source]

list_diff(list1, list2, *args)

Difference between first and any number of lists

list_1 = ["1", 2, 3, 4, "5", 77, -7]
list_2 = [3, "5"]
list_3 = [4, -7]
list_4 = ["bla-bla", 0, 77]
list_diff(list_1, list_2, list_3, list_4)
['1', 2]
test_eq(list_diff(list_1, list_2, list_3, list_4), ['1', 2])

which_elms[source]

which_elms(values:list, in_list:list)

Just returns elements from values that are in list in_list

which_elms(list_1, list_2)
[3, '5']
which_elms(list_1, list_4)
[77]
test_eq(which_elms(list_1, list_2), [3, '5'])
test_eq(which_elms(list_1, list_4), [77])

is_in_list[source]

is_in_list(values:list, in_list:list)

Just returns is any of the elements from values is in list in_list

listify[source]

listify(p=None, match=None)

Make p listy and the same length as match.

isNone[source]

isNone(cond)

isNotNone[source]

isNotNone(cond)