holoviz / holoviz/datashader

Using categorical coloring for separate aggregates

Open
#513 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.6k
Forks
376
Avg merge
4h 32m
Merged PRs (30d)
1

Description

If we have a dataframe with points in it that each have a category assigned in some other column, we can generate a single image from it where each pixel's color is an average of the category colors, weighted by the counts for each category:

![image](https://user-images.githubusercontent.com/1695496/32072554-96e962e4-ba58-11e7-99c3-d5c425289112.png)

However, weighted-color-average plots are also useful in cases where no category field is available. Right now, if you wanted to use the category coloring to show NYC taxi pickups vs. dropoffs, you could create a new data frame twice as long as the old one, with each row representing a pickup or dropoff only (instead of a pickup,dropoff pair as it is now), and synthesize a new column indicating whether each point was a pickup or a dropoff. It seems helpful if we provide at least an example, if not a utility, of how to avoid having to doctor the original dataset in this way, because we should be able to make the same calculation simply from the separate aggregates by packing them into the appropriate xarray data structure expected by shade() when given categorical data.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.