2. Matplotlib Pandas

2.1. Visualizing data

2.1.1. Hist

import matplotlib.pyplot as plt
import pandas as pd

url = 'https://raw.githubusercontent.com/AstroMatt/book-python/master/data-vizualization/data/iris.csv'
data = pd.read_csv(url)

data.hist()
data.show()
../_images/matplotlib-pd-hist.png

Fig. 2.13. Vizualization using hist

2.1.2. Density

import matplotlib.pyplot as plt
import pandas as pd

url = 'https://raw.githubusercontent.com/AstroMatt/book-python/master/data-vizualization/data/iris.csv'
data = pd.read_csv(url)

data.plot(kind='density', subplots=True, layout=(3,3), sharex=False)
data.show()
../_images/matplotlib-pd-density.png

Fig. 2.14. Vizualization using density

2.1.3. Box

import matplotlib.pyplot as plt
import pandas as pd

url = 'https://raw.githubusercontent.com/AstroMatt/book-python/master/data-vizualization/data/iris.csv'
data = pd.read_csv(url)

data.plot(kind='box', subplots=True, layout=(3,3), sharex=False, sharey=False)
data.show()
../_images/matplotlib-pd-box.png

Fig. 2.15. Vizualization using density

2.1.4. Scatter matrix

import matplotlib.pyplot as plt
import pandas as pd
from pandas.plotting import scatter_matrix

url = 'https://raw.githubusercontent.com/AstroMatt/book-python/master/data-vizualization/data/iris.csv'
data = pd.read_csv(url)

scatter_matrix(data)
plt.show()
../_images/matplotlib-pd-scatter-matrix.png

Fig. 2.16. Vizualization using density