Esempio n. 1
0
            table=0,
            status="active",
            drop=False,
            direction="right",
            method="copy",
            row=dw.Row(column=[],
                       table=0,
                       status="active",
                       drop=False,
                       conditions=[
                           dw.RowIndex(column=[],
                                       table=0,
                                       status="active",
                                       drop=False,
                                       indices=[0, 1, 2])
                       ])))

# Fold split1, split2, split3, split4...  using  1, 2, 3  as keys
w.add(
    dw.Fold(column=[
        "split1", "split2", "split3", "split4", "split5", "split6", "split7",
        "split8", "split9", "split10", "split11", "split12", "split13",
        "split14", "split15", "split16"
    ],
            table=0,
            status="active",
            drop=False,
            keys=[0, 1, 2]))

w.apply_to_file('migration.csv').print_csv('out.csv')
Esempio n. 2
0
              drop=False,
              row=dw.Row(column=[],
             table=0,
             status="active",
             drop=False,
             conditions=[dw.Empty(column=[],
               table=0,
               status="active",
               drop=False,
               percent_valid=0,
               num_valid=0)])))

# Fold wrap, wrap1, wrap2, wrap3...  using  header as a key
w.add(dw.Fold(column=["wrap","wrap1","wrap2","wrap3","wrap4","wrap5"],
              table=0,
              status="active",
              drop=False,
              keys=[-1]))

# Translate value up
w.add(dw.Translate(column=["value"],
                   table=0,
                   status="active",
                   drop=False,
                   direction="up",
                   values=1))

# Drop value
w.add(dw.Drop(column=["value"],
              table=0,
              status="active",
Esempio n. 3
0
                row=dw.Row(column=[],
             table=0,
             status="active",
             drop=False,
             conditions=[dw.IsNull(column=[],
                table=0,
                status="active",
                drop=False,
                lcol="Location",
                value=None,
                op_str="is null")])))

# Fold 2003, 2004, 2005, 2006...  using  header as a key
w.add(dw.Fold(column=["_2003","_2004","_2005","_2006","_2007","_2008","_2009","_2010","_2011","_2012","_2013","_2014","_2015","_2016","_2017","_2018","_2019"],
              table=0,
              status="active",
              drop=False,
              keys=[-1]))

# Set  fold  name to  year
w.add(dw.SetName(column=["fold"],
                 table=0,
                 status="active",
                 drop=True,
                 names=["year"],
                 header_row=None))

# Delete  rows where value is null
w.add(dw.Filter(column=[],
                table=0,
                status="active",
Esempio n. 4
0
w.add(
    dw.SetName(column=["split3"],
               table=0,
               status="active",
               drop=True,
               names=["4"],
               header_row=None))

# Drop split4
w.add(dw.Drop(column=["split4"], table=0, status="active", drop=True))

# Fold 1, 2, 3, 4  using  header as a key
w.add(
    dw.Fold(column=["_1", "_2", "_3", "_4"],
            table=0,
            status="active",
            drop=False,
            keys=[-1]))

# Set  fold  name to  Rank
w.add(
    dw.SetName(column=["fold"],
               table=0,
               status="active",
               drop=True,
               names=["Rank"],
               header_row=None))

# Set  extract  name to  Nation
w.add(
    dw.SetName(column=["extract"],
Esempio n. 5
0
w.add(
    dw.Split(column=["data"],
             table=0,
             status="active",
             drop=True,
             result="column",
             update=False,
             insert_position="right",
             row=None,
             on=",",
             before=None,
             after=None,
             ignore_between=None,
             which=1,
             max=0,
             positions=None,
             quote_character=None))

# Fold split1, split2  using  1 as a key
w.add(
    dw.Fold(column=["split1", "split2"],
            table=0,
            status="active",
            drop=False,
            keys=[0]))

# Drop fold
w.add(dw.Drop(column=["fold"], table=0, status="active", drop=True))

w.apply_to_file('pldi-figure-6.csv').print_csv('out.csv')
             drop=True,
             result="row",
             update=False,
             insert_position="right",
             row=None,
             on="\n",
             before=None,
             after=None,
             ignore_between=None,
             which=1,
             max=0,
             positions=None,
             quote_character=None))

# Fold   using  1 as a key
w.add(dw.Fold(column=[], table=0, status="active", drop=False, keys=[0]))

# Delete  every 7 rows
w.add(
    dw.Filter(column=[],
              table=0,
              status="active",
              drop=False,
              row=dw.Row(column=[],
                         table=0,
                         status="active",
                         drop=False,
                         conditions=[
                             dw.RowCycle(column=[],
                                         table=0,
                                         status="active",
Esempio n. 7
0
                 drop=True,
                 names=["3"],
                 header_row=None))

# Set  split4  name to  4
w.add(dw.SetName(column=["split4"],
                 table=0,
                 status="active",
                 drop=True,
                 names=["4"],
                 header_row=None))

# Fold   using  header as a key
w.add(dw.Fold(column=[],
              table=0,
              status="active",
              drop=False,
              keys=[-1]))

# Extract from value between '|' and '}'
w.add(dw.Extract(column=["value"],
                 table=0,
                 status="active",
                 drop=False,
                 result="column",
                 update=False,
                 insert_position="right",
                 row=None,
                 on=".*",
                 before="}",
                 after="\\|",