Complete the code to import the Datashader library.
import [1]
Datashader is imported using import datashader.
Complete the code to create a canvas with Datashader for a 1000x1000 pixel plot.
canvas = datashader.Canvas([1]=1000, [2]=1000)
The Canvas object uses width and height to set pixel dimensions.
Fix the error in the code to aggregate points using Datashader's points method.
agg = canvas.points(df, x='x', y='y', [1]='value')
The correct parameter name is agg_col to specify the column to aggregate.
Fill both blanks to create a HoloViews Points plot and display it.
import holoviews as hv hv.extension('matplotlib') points = hv.Points(df, kdims=[[1]], vdims=[[2]]) points.opts(color='blue', size=5)
In HoloViews, kdims are key dimensions like 'x', and vdims are value dimensions like 'value'.
Fill all three blanks to create a Datashader aggregate and convert it to an image with HoloViews.
agg = canvas.points(df, x=[1], y=[2], agg_col=[3]) img = hv.Image(agg) img.opts(cmap='viridis')
The x and y parameters specify coordinates, and agg_col specifies the data column to aggregate.
