from lesson 03_Data_ Sources_&_Transformations
And now, we have fallen off the cliff:
# Exercise: use the corresponding factor_cmap to color map a scatter plot of the iris data set
from bokeh.palettes import Viridis256
from bokeh.sampledata.iris import flowers
from bokeh.transform import factor_cmap
p = figure(title="Factor Color Map")
p.scatter(flowers['petal_width'], flowers['petal_length'], color=factor_cmap(flowers['species'], Viridis256. factors == flowers['species']))
show(p)
First:
TypeError: factor_cmap() missing 1 required positional argument: ‘factors’
And then:
AttributeError: ‘tuple’ object has no attribute ‘factors’
Given the failure of the preceding exercise with log_cmap, the failure here is not the least bit surprising to me, since this is very nearly the identical issue I came to the forum about the first time. I don’t get it. Please explain it to me like I was 5 years old.

