Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: heatmap aggregation when kdims are in a Pandas multi-index #6499

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Jan 27, 2025

The optimizations recently done in HoloViews and hvPlot to avoid unnecessary Pandas copies have exposed this bug reported first on hvPlot's issue tracker holoviz/hvplot#1467.

import xarray as xr
import pandas as pd
import holoviews as hv
hv.extension('bokeh')

da = xr.DataArray([[0.5, 0.2], [-0.1, 0.5]], dims=["A", "B"], name="C")
df = da.to_dataframe()
heatmap = hv.HeatMap(df, ['A', 'B'], ['C'])
hv.render(heatmap)

Error: KeyError: "None of ['A', 'B'] are in the columns".

@maximlt maximlt changed the title Fix heatmap aggregation when kdims are in a Pandas multi-index fix: heatmap aggregation when kdims are in a Pandas multi-index Jan 27, 2025
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.79%. Comparing base (d9861ae) to head (b4e63c0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6499   +/-   ##
=======================================
  Coverage   88.79%   88.79%           
=======================================
  Files         323      323           
  Lines       68731    68742   +11     
=======================================
+ Hits        61028    61039   +11     
  Misses       7703     7703           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

holoviews/element/util.py Outdated Show resolved Hide resolved
Co-authored-by: Simon Høxbro Hansen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants