Beispiel #1
0
def test_diffvalues():

    table1 = (('foo', 'bar'), ('a', 1), ('b', 3))

    table2 = (('bar', 'foo'), (1, 'a'), (3, 'c'))

    add, sub = diffvalues(table1, table2, 'foo')
    assertequal({'c'}, add)
    assertequal({'b'}, sub)
Beispiel #2
0
def test_diffvalues():

    table1 = (('foo', 'bar'), ('a', 1), ('b', 3))

    table2 = (('bar', 'foo'), (1, 'a'), (3, 'c'))

    add, sub = diffvalues(table1, table2, 'foo')
    eq_(set(['c']), add)
    eq_(set(['b']), sub)
Beispiel #3
0
def test_diffvalues():

    table1 = (("foo", "bar"), ("a", 1), ("b", 3))

    table2 = (("bar", "foo"), (1, "a"), (3, "c"))

    add, sub = diffvalues(table1, table2, "foo")
    eq_(set(["c"]), add)
    eq_(set(["b"]), sub)
Beispiel #4
0
def test_diffvalues():
    
    table1 = (('foo', 'bar'),
              ('a', 1),
              ('b', 3))

    table2 = (('bar', 'foo'),
              (1, 'a'),
              (3, 'c'))
    
    add, sub = diffvalues(table1, table2, 'foo')
    eq_(set(['c']), add)
    eq_(set(['b']), sub)
Beispiel #5
0
def test_diffvalues():
    
    table1 = (('foo', 'bar'),
              ('a', 1),
              ('b', 3))

    table2 = (('bar', 'foo'),
              (1, 'a'),
              (3, 'c'))
    
    add, sub = diffvalues(table1, table2, 'foo')
    assertequal({'c'}, add)
    assertequal({'b'}, sub)
Beispiel #6
0
add, sub = etl.diffheaders(table1, table2)
add
sub


# diffvalues()
##############

import petl as etl
table1 = [['foo', 'bar'],
          ['a', 1],
          ['b', 3]]
table2 = [['bar', 'foo'],
          [1, 'a'],
          [3, 'c']]
add, sub = etl.diffvalues(table1, table2, 'foo')
add
sub


# nthword()
###########

import petl as etl
s = 'foo bar'
f = etl.nthword(0)
f(s)
g = etl.nthword(1)
g(s)

Beispiel #7
0
# diffheaders()
###############

import petl as etl
table1 = [['foo', 'bar', 'baz'], ['a', 1, .3]]
table2 = [['baz', 'bar', 'quux'], ['a', 1, .3]]
add, sub = etl.diffheaders(table1, table2)
add
sub

# diffvalues()
##############

import petl as etl
table1 = [['foo', 'bar'], ['a', 1], ['b', 3]]
table2 = [['bar', 'foo'], [1, 'a'], [3, 'c']]
add, sub = etl.diffvalues(table1, table2, 'foo')
add
sub

# nthword()
###########

import petl as etl
s = 'foo bar'
f = etl.nthword(0)
f(s)
g = etl.nthword(1)
g(s)