コード例 #1
0
ファイル: test_util.py プロジェクト: greeness/petl
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)
コード例 #2
0
ファイル: test_util.py プロジェクト: pombredanne/petl
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)
コード例 #3
0
ファイル: test_util.py プロジェクト: talwai/petl
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)
コード例 #4
0
ファイル: test_util.py プロジェクト: obsoleter/petl
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)
コード例 #5
0
ファイル: test_util.py プロジェクト: greeness/petl
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)
コード例 #6
0
ファイル: misc.py プロジェクト: DeanWay/petl
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)

コード例 #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)