plotting tools
code
-
import code
import matplotlib.pyplot as plt import matplotlib matplotlib.style.use('ggplot') import numpy as np import pandas as pd %matplotlib inline
-
from pandas.tools.plotting import scatter_matrix df = pd.DataFrame(np.random.randn(1000, 4), columns=['a', 'b', 'c', 'd']) scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='kde')
-
ser = pd.Series(np.random.randn(1000)) ser.plot(kind='kde')
-
from pandas import read_csv from pandas.tools.plotting import andrews_curves data = pd.read_csv('iris.data') plt.figure() andrews_curves(data, 'Name')
-
from pandas import read_csv from pandas.tools.plotting import parallel_coordinates data = read_csv('iris.data') plt.figure() parallel_coordinates(data, 'Name')
-
from pandas.tools.plotting import lag_plot plt.figure() data = pd.Series(0.1 * np.random.rand(1000) + 0.9 * np.sin(np.linspace(-99 * np.pi, 99 * np.pi, num=1000))) lag_plot(data)
-
from pandas.tools.plotting import autocorrelation_plot plt.figure() data = pd.Series(0.7 * np.random.rand(1000) + 0.3 * np.sin(np.linspace(-9 * np.pi, 9 * np.pi, num=1000))) autocorrelation_plot(data)
-
from pandas.tools.plotting import bootstrap_plot data = pd.Series(np.random.rand(1000)) bootstrap_plot(data, size=50, samples=500, color='grey')
-
from pandas import read_csv from pandas.tools.plotting import radviz data = read_csv('iris.data') plt.figure() radviz(data, 'Name')