from sklearn import datasets
import pandas as pd
raw_data = datasets.load_iris()
# Load iris dataset
iris_df = pd.DataFrame(raw_data.data)
iris_df['class'] = raw_data.target.astype('str')
iris_df.columns=['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'class']
iris_df
!pip install plotly
Collecting plotly
Downloading plotly-4.12.0-py2.py3-none-any.whl (13.1 MB)
|āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā| 13.1 MB 12.3 MB/s
Collecting retrying>=1.3.3
Downloading retrying-1.3.3.tar.gz (10 kB)
Requirement already satisfied: six in /opt/venv/lib/python3.7/site-packages (from plotly) (1.15.0)
Building wheels for collected packages: retrying
Building wheel for retrying (setup.py) ... done
Created wheel for retrying: filename=retrying-1.3.3-py3-none-any.whl size=11429 sha256=be96e4bba539c6aff2161ba181fbcb526a65bfd811f1e6dfcb126cf567c617d6
Stored in directory: /home/jovyan/.cache/pip/wheels/f9/8d/8d/f6af3f7f9eea3553bc2fe6d53e4b287dad18b06a861ac56ddf
Successfully built retrying
Installing collected packages: retrying, plotly
Successfully installed plotly-4.12.0 retrying-1.3.3
import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig.show()
!pip list
Package Version
---------------------- ----------
async-generator 1.10
attrs 20.3.0
backcall 0.2.0
bleach 3.2.1
certifi 2020.6.20
chardet 3.0.4
cycler 0.10.0
decorator 4.4.2
defusedxml 0.6.0
entrypoints 0.3
idna 2.10
importlib-metadata 2.0.0
ipykernel 5.3.4
ipython 7.19.0
ipython-genutils 0.2.0
ipywidgets 7.5.1
jedi 0.17.2
Jinja2 2.11.2
joblib 0.17.0
jsonschema 3.2.0
jupyter-client 6.1.7
jupyter-core 4.6.3
jupyterlab-pygments 0.1.2
kiwisolver 1.3.1
MarkupSafe 1.1.1
matplotlib 3.3.2
mistune 0.8.4
nbclient 0.5.1
nbconvert 6.0.7
nbformat 5.0.8
nest-asyncio 1.4.2
notebook 7.0.0.dev0
numpy 1.19.4
packaging 20.4
pandas 1.0.5
pandocfilters 1.4.3
parso 0.7.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 8.0.1
pip 20.2.4
pluggy 1.0.0.dev0
prometheus-client 0.8.0
prompt-toolkit 3.0.8
ptyprocess 0.6.0
Pygments 2.7.2
pyparsing 2.4.7
pyrsistent 0.17.3
python-dateutil 2.8.1
python-jsonrpc-server 0.4.0
python-language-server 0.4
pytz 2020.4
pyzmq 19.0.2
requests 2.24.0
scikit-learn 0.23.2
scipy 1.5.4
Send2Trash 1.5.0
setuptools 50.3.2
six 1.15.0
terminado 0.9.1
testpath 0.4.4
threadpoolctl 2.1.0
tornado 6.1
traitlets 5.0.5
ujson 4.0.1
urllib3 1.25.11
wcwidth 0.2.5
webencodings 0.5.1
wheel 0.35.1
widgetsnbextension 3.5.1
zipp 3.4.0