<jupyter_start><jupyter_text>New to Plotly?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/).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).We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!  Version CheckPlotly's python package is updated frequently. Run `pip install plotly --upgrade` to use the latest version.<jupyter_code>import plotly
plotly.__version__<jupyter_output><empty_output><jupyter_text>Basic Example<jupyter_code>import plotly.offline as off

off.init_notebook_mode(connected=True)

subject = ['Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly']
score = [1,6,2,8,2,9,4,5,1,5,2,8]

data = [dict(
  type = 'scatter',
  x = subject,
  y = score,
  mode = 'markers',
  transforms = [dict(
    type = 'groupby',
    groups = subject,
    styles = [
        dict(target = 'Moe', value = dict(marker = dict(color = 'blue'))),
        dict(target = 'Larry', value = dict(marker = dict(color = 'red'))),
        dict(target = 'Curly', value = dict(marker = dict(color = 'black')))
    ]
  )]
)]

off.iplot({'data': data}, validate=False)<jupyter_output><empty_output><jupyter_text>ReferenceSee https://plot.ly/python/reference/ for more information and chart attribute options!<jupyter_code>from IPython.display import display, HTML

display(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Inconsolata|Ubuntu+Mono:400,700" rel="stylesheet" type="text/css" />'))
display(HTML('<link rel="stylesheet" type="text/css" href="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">'))

! pip install git+https://github.com/plotly/publisher.git
import publisher
publisher.publish(
    'groupby.ipynb', 'python/group-by/', 'Group By',
    'How to use group by in Python with Plotly.',
    title = 'Group By | Plotly',
    has_thumbnail='true', thumbnail='thumbnail/groupby.jpg', 
    language='python', uses_plotly_offline=True,
    page_type='example_index',
    display_as='transforms', order=2,
    ipynb= '~notebook_demo/194')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1619607843137255, 'fraction_numerical': 0.013333333333333334, 'mean_word_length': 5.524296675191816, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '244780', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 896, 'n_tokens_neox': 852, 'n_words': 164, 'path': '_posts/python-v3/transforms/groupby/groupby.ipynb', 'repo_name': 'bmb804/documentation', 'size': '2550'}