from ipywidgets import interact
import numpy as np
import pandas as pd
import plotly.express as px
import matplotlib.pyplot as plt
%matplotlib inline
uci = 'http://archive.ics.uci.edu/ml/machine-learning-databases/'
iris = pd.read_csv(uci + 'iris/iris.data', header=None,
names = ['sepal lenght', 'sapal width',
'petal lenght', 'petal width',
'class'])
iris[0:5]
def square(x):
return x * x
interact(square, x=(0, 100, 10));
iris_fro = iris[0:5]
iris_sel = iris_fro[['sepal lenght','sapal width']]
iris_sel
px.scatter(iris_sel, x='sepal lenght', y='sapal width')
px.scatter(iris, x='sepal lenght', y='sapal width', color='class', hover_name='petal lenght')
px.scatter(iris, x='sepal lenght', y='sapal width', color='sepal lenght', hover_name='petal lenght')
px.scatter(iris, x='sepal lenght', y='sapal width', color='class', size='sepal lenght', hover_name='petal width')
px.scatter_3d(iris, x='sepal lenght', z='sapal width', y='petal lenght', color='class')
px.scatter_matrix(iris, color='class')
gapminder = px.data.gapminder()
gapminder[0:10]
gapminder.query('country=="Germany"')