Module Assign NameStore Str ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad SubscriptLoad NameLoad Index CompareEq AttributeLoad NameLoad attr NameLoad attr attr Assign NameStore SubscriptLoad NameLoad Index BinOpBitOr CompareNotEq AttributeLoad NameLoad attr NameLoad BinOpBitAnd CompareEq AttributeLoad NameLoad attr NameLoad UnaryOpInvert Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Import alias Expr Call AttributeLoad NameLoad attr
N/A N/A __author__ linas pandas DataFrame not_new_items_filter N/A N/A training testing N/A N/A N/A 
    Given two data frames, it filters from the testing frame all the non-new items.
    A new item is the one that was not seen in the training set.

    >>> training = DataFrame({'user' : [1, 1, 1, 2], 'item' : [1, 2, 3, 4]})
    >>> testing = DataFrame({'user' : [1, 1, 1, 2], 'item' : [3, 1, 4, 4]})
    >>> testing = not_new_items_filter(training, testing)
    >>> len(testing)#only user 1 has item 4 not seen in training set of user 1
    1
    >>> int(testing['item'])
    4
     N/A test_users N/A N/A N/A testing user unique N/A u test_users N/A N/A training_items_of_u N/A N/A N/A N/A training N/A N/A N/A training user u item unique N/A testing N/A testing N/A N/A N/A N/A testing user u N/A N/A N/A testing user u N/A N/A N/A N/A testing item isin training_items_of_u N/A testing N/A N/A N/A __name__ __main__ N/A N/A doctest N/A N/A N/A doctest testmod