{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### New to Plotly?\n",
"Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/).\n",
"
You can set up Plotly to work in [online](https://plot.ly/python/getting-started/#initialization-for-online-plotting) or [offline](https://plot.ly/python/getting-started/#initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plot.ly/python/getting-started/#start-plotting-online).\n",
"
We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Version Check\n",
"Plotly's python package is updated frequently. Run `pip install plotly --upgrade` to use the latest version."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'2.2.3'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import plotly\n",
"plotly.__version__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Introduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Aggregates are a type of transform that can be applied to values in a given expression. Available aggregations are:\n",
"\n",
"Function | Description\n",
"------------- | -------------\n",
"`count` | Returns the quantity of items for each group.\n",
"`sum` | Returns the summation of all numeric values.\n",
"`avg` | Returns the average of all numeric values.\n",
"`median` | Returns the median of all numeric values.\n",
"`mode` | Returns the mode of all numeric values.\n",
"`rms` | Returns the rms of all numeric values.\n",
"`stddev` | Returns the standard deviation of all numeric values.\n",
"`min` | Returns the minimum numeric value for each group.\n",
"`max` | Returns the maximum numeric value for each group.\n",
"`first` | Returns the first numeric value for each group.\n",
"`last` | Returns the last numeric value for each group."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Basic Example"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/vnd.plotly.v1+html": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"data": [
{
"mode": "markers",
"transforms": [
{
"aggregations": [
{
"enabled": true,
"func": "sum",
"target": "y"
}
],
"groups": [
"Moe",
"Larry",
"Curly",
"Moe",
"Larry",
"Curly",
"Moe",
"Larry",
"Curly",
"Moe",
"Larry",
"Curly"
],
"type": "aggregate"
}
],
"type": "scatter",
"x": [
"Moe",
"Larry",
"Curly",
"Moe",
"Larry",
"Curly",
"Moe",
"Larry",
"Curly",
"Moe",
"Larry",
"Curly"
],
"y": [
1,
6,
2,
8,
2,
9,
4,
5,
1,
5,
2,
8
]
}
],
"layout": {}
},
"text/html": [
"