Skip to content
Kyle Ward edited this page Sep 21, 2016 · 1 revision

Some examples of how this GISDK library could be used.

Start with a table in a CSV file (example.csv)

Size Color Count
Small Red 50
Small Yellow 75
Small Blue 25
Medium Red 100
Medium Blue 115
Large Yellow 35

Use gplyr to read in the table and summarize by "Count"

df = CreateObject("df")  
df.read_csv(example.csv)  
df.group_by("Color")  
stat.Count = {"sum", "avg"}  
df.summarize(stat)

During development, the contents of the data frame can be viewed by calling

df.create_editor()

Color sum_Count avg_Count
Blue 140 70
Red 150 75
Yellow 110 55

Often the output is written back out to a CSV. (output.csv)

df.write_csv(output.csv)