<jupyter_start><jupyter_text>Plotly and Cufflinks for plotting with Pandas Get cufflinksCufflinks integrates plotly with pandas to allow plotting right from pandas dataframes. Install using `pip````pip install cufflinks```<jupyter_code>import numpy as np
import pandas as pd
import cufflinks as cf
from plotly.offline import download_plotlyjs, init_notebook_mode
from plotly.offline import plot, iplot

#set notebook mode
init_notebook_mode(connected=True)
cf.go_offline()
df = pd.DataFrame(np.random.randn(100,4), 
                  columns='A B C D'.split(' '))
df.head()
df2 = pd.DataFrame({'category':['A','B','C'], 'values':[33,56,67]})
df2<jupyter_output><empty_output><jupyter_text>interactive plotting line plotsWith Plotly, you can turn on and off data values by clicking on the legend<jupyter_code>df.iplot()<jupyter_output><empty_output><jupyter_text>bar plot<jupyter_code>df2.iplot(kind='bar')<jupyter_output><empty_output><jupyter_text>box plot<jupyter_code>df.iplot(kind='box')<jupyter_output><empty_output><jupyter_text>surface plot<jupyter_code>df3 = pd.DataFrame({'x':[1,2,3,4,5],
                   'y':[11,22,33,44,55],
                    'z':[5,4,3,2,1]})
df3
df3.iplot(kind='surface')<jupyter_output><empty_output><jupyter_text>histograms<jupyter_code>df.iplot(kind='hist',bins=50)<jupyter_output><empty_output><jupyter_text>spread plotsUsed to show the spread in data value between two columns / variables.<jupyter_code>df[['A','B']].iplot(kind='spread')<jupyter_output><empty_output><jupyter_text>bubble scatter plotssame as scatter, but you can easily size the dots by another column<jupyter_code>df.iplot(kind='bubble',x='A', y='B', size='C')<jupyter_output><empty_output><jupyter_text>scatter matrixThis is similar to seaborn's pairplot<jupyter_code>df.scatter_matrix()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13526834611171962, 'fraction_numerical': 0.0208105147864184, 'mean_word_length': 7.868932038834951, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '584263', 'license': 'MIT', 'n_tokens_mistral': 701, 'n_tokens_neox': 661, 'n_words': 121, 'path': 'python_crash_course/plotly_cufflinks_cheat_sheet_2.ipynb', 'repo_name': 'AtmaMani/pyChakras', 'size': '1826'}