Loading some data and Matplotlib graphing tutorial

Using python in a jupyter notebook allows you to write text and code together.


In [1]:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline

In [2]:
df = pd.read_csv('datasets/iris.csv',index_col=4,header=None,names=['SepalLength', 'SepalWidth', 'PetalLength','PetalWidth'],sep=',')
df.head()


Out[2]:
SepalLength SepalWidth PetalLength PetalWidth
Iris-setosa 5.1 3.5 1.4 0.2
Iris-setosa 4.9 3.0 1.4 0.2
Iris-setosa 4.7 3.2 1.3 0.2
Iris-setosa 4.6 3.1 1.5 0.2
Iris-setosa 5.0 3.6 1.4 0.2

In [3]:
df.tail()


Out[3]:
SepalLength SepalWidth PetalLength PetalWidth
Iris-virginica 6.7 3.0 5.2 2.3
Iris-virginica 6.3 2.5 5.0 1.9
Iris-virginica 6.5 3.0 5.2 2.0
Iris-virginica 6.2 3.4 5.4 2.3
Iris-virginica 5.9 3.0 5.1 1.8

In [ ]:


In [3]:
plt.scatter(df['SepalLength'],df['SepalWidth'],df['PetalLength'])


Out[3]:
<matplotlib.collections.PathCollection at 0x7f8e3c01a5c0>

In [25]:


In [ ]: