# The DataFrame

# A Table

With Chartnado everything is based around the concept of the DataFrame. A DataFrame is nothing more than a table of data resulting from some operation.

For example, given the table of data:

Country Region Sales
USA North 100
USA North 200
USA South 300
USA South 400
Canada North 700
Canada North 800
Canada North 900

If we were to group the data by Country the result would be 2 groups: USA and Canada. Each group has a Key (country name) and a DataFrame of the rows:

Key DataFrame
USA USA Rows
Canada Canada Rows
Country Region Sales
USA North 100
USA North 200
USA South 300
USA South 400
Country Region Sales
Canada North 700
Canada North 800
Canada North 900

One of the most important points in Chartnado is that all calculations are done on the rows contained in a DataFrame.

So to calculate the sum of Sales for each country the rows from the relevant DataFrame would be used.