October 2018
Beginner to intermediate
676 pages
18h 30m
English
Here are the steps to implement the logic:
iris = pd.read_csv('iris_dataset.csv', delimiter=',')iris['species'] = iris['species'].map({"setosa" : 0, "versicolor" : 1, "virginica" : 2})x, y, z = iris['petal_length'], iris['petal_width'], iris['species']
fig = plt.figure(figsize=(8,6))ax = fig.add_subplot(111, projection='3d')
for name, c, marker in zip((0, 1, 2), ('r', 'b', 'g'), ('o', '^', '*')): index = iris['species'] == name ax.scatter(x[index], y[index], z[index], s=25*x[index]*y[index], c=c, marker=marker)
Read now
Unlock full access