In [39]:
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline
matplotlib.style.use("ggplot")
In [40]:
file_path = "/Users/szabolcs/dev/git/DAT210x/Module3/Datasets/"
file_name = "wheat.data"
df = pd.read_csv(file_path + file_name)
df.head()
Out[40]:
In [41]:
df.asymmetry.plot.hist(title="Asymmetry", bins=8)
plt.show()
In [42]:
wheat_types = df.wheat_type.unique()
print(wheat_types)
plt.figure()
for wtype in wheat_types:
df[df.wheat_type == wtype].asymmetry.plot.hist(alpha=0.4)
plt.show()
In [46]:
plt.figure()
wheat_df = df[["asymmetry", "perimeter"]]
wheat_df.plot.hist(alpha=0.5)
plt.show()
In [ ]: