## Calculating the Mean

In data science, the arithmetic mean is known as the average. It is the central value in a finite data set of numbers. We can calculate the mean by finding the sum of all values in a dataset and divide it by the number of values.

$$\overline{x}=\frac{1}{n}\left(\sum _{i=0}^{n}{x}_{i}\right)$$The arithmetic mean can be calculated in Quorum by using the helper action, Mean() within the DataFrame's class. To do this, we will use our 'frame' object and call the function Mean(). In this case we will be calculating the mean of the perimeter and the area of dry bean classifications. Here is a brief description on how Mean() works.

Function | Description | Usage |
---|---|---|

dataFrameObject:Mean() | This action calculates the mean of the column selected from the frame. Note that it can only calculate the mean of one column at a time. | frame:Mean() |

Here is some code on how to calculate the mean:

```
//We need the DataFrame class to load in files for Data Science operations.
use Libraries.Compute.Statistics.DataFrame
//Create a DataFrame, which is essentially a table that understands
//more information about the data that is being loaded.
DataFrame frame
//This loads data relative to the project, so put the dryBeans file in the Data/Miscellaneous folder
frame:Load("../Data/Miscellaneous/DryBeans.csv")
//Tell the frame we want the first column selected
frame:AddSelectedColumn(0)
text someText = "Mean of the first column (Area) of dry beans:"
output someText
output frame:Mean()
```

## Run the Example

Example of calculating the mean

## Code Area

## Output Area

Congrats! We have just learned how to calulate the mean! To view the whole file, we can click here.

## Next Tutorial

In the next tutorial, we will discuss median, which describes calculating the median.