Exemple #1
0
                row=dw.Row(column=[],
             table=0,
             status="active",
             drop=False,
             conditions=[dw.Contains(column=[],
                  table=0,
                  status="active",
                  drop=False,
                  lcol="split",
                  value="Reported",
                  op_str="contains")])))

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

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

# Set  split1  name to  Crime
w.add(dw.SetName(column=["split1"],
                 table=0,
                 status="active",
Exemple #2
0
# Split data repeatedly on ','
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))

# Promote row 2  to header
w.add(
    dw.SetName(column=[],
               table=0,
               status="active",
               drop=True,
               names=[],
               header_row=1))

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

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

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

# Set  split2  name to  3
w.add(
    dw.SetName(column=["split2"],
Exemple #4
0
               update=False,
               insert_position="right",
               row=None,
               on="\t",
               before=None,
               after=None,
               ignore_between=None,
               which=1,
               max=0,
               positions=None,
               quote_character=None))

# Promote row 1  to header
w.add(dw.SetName(column=[],
                 table=0,
                 status="active",
                 drop=True,
                 names=[],
                 header_row=0))

# Delete  rows where Location is null
w.add(dw.Filter(column=[],
                table=0,
                status="active",
                drop=False,
                row=dw.Row(column=[],
             table=0,
             status="active",
             drop=False,
             conditions=[dw.IsNull(column=[],
                table=0,
                status="active",
           update=True,
           insert_position="right",
           row=None,
           on="\"",
           before=None,
           after=None,
           ignore_between=None,
           which=1,
           max=0,
           positions=None))

# Promote row 1  to header
w.add(
    dw.SetName(column=[],
               table=0,
               status="active",
               drop=True,
               names=[],
               header_row=0))

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

# Extract from index between 'Contest ' and ','
w.add(
    dw.Extract(column=["index"],
                status="active",
                drop=False,
                row=dw.Row(column=[],
             table=0,
             status="active",
             drop=False,
             conditions=[dw.RowIndex(column=[],
                  table=0,
                  status="active",
                  drop=False,
                  indices=[0])])))

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

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

# Set  split2  name to  Position
w.add(dw.SetName(column=["split2"],
                 table=0,
                 status="active",
              measure="split2"))

# Delete row 25
w.add(
    dw.Filter(column=[],
              table=0,
              status="active",
              drop=False,
              row=dw.Row(column=[],
                         table=0,
                         status="active",
                         drop=False,
                         conditions=[
                             dw.RowIndex(column=[],
                                         table=0,
                                         status="active",
                                         drop=False,
                                         indices=[24])
                         ])))

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

w.apply_to_file(sys.argv[1]).print_csv(sys.argv[2])
               update=False,
               insert_position="right",
               row=None,
               on=",",
               before=None,
               after=None,
               ignore_between=None,
               which=1,
               max=0,
               positions=None,
               quote_character=None))

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

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

# Set  split2  name to  Instructor
w.add(dw.SetName(column=["split2"],
                 table=0,
                 status="active",
Exemple #9
0
                status="active",
                drop=False,
                row=dw.Row(column=[],
             table=0,
             status="active",
             drop=False,
             conditions=[dw.RowIndex(column=[],
                  table=0,
                  status="active",
                  drop=False,
                  indices=[0])])))

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

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

# Set  split3  name to  3
w.add(dw.SetName(column=["split3"],
                 table=0,
                 status="active",