view misc.py @ 99:a8da709eb6a9

in ArrayDataSet.__init__ if a columns is an index, we change it to be a list that containt only this index. This way, we remove the special case where the columns is an index for all subsequent call. This was possing trouble with numpy.vstack() called by MinibatchWrapAroundIterator.next
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 06 May 2008 13:57:36 -0400
parents 718befdc8671
children e9a95e19e6f8
line wrap: on
line source


def unique_elements_list_intersection(list1,list2):
    """
    Return the unique elements that are in both list1 and list2
    (repeated elements in listi will not be duplicated in the result).
    This should run in O(n1+n2) where n1=|list1|, n2=|list2|.
    """
    return list(set.intersection(set(list1),set(list2)))