holoviz / holoviz/hvplot

Bad error message for missing kwarg in labels

Open
#1,280 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

```python
import pandas as pd
import hvplot.pandas
import holoviews as hv

df = pd.read_csv(
"https://raw.githubusercontent.com/ajstarks/dubois-data-portraits/master/challenge/2024/challenge03/data.csv",
header=None,
names=["year", "acres"],
)
df.loc[11, "year"] = 1886 # from 1888 to 1886
df_0 = df.iloc[0]
df_n = df.iloc[-1]

df_0.hvplot.labels()
```

```
File [~/repos/hvplot/hvplot/converter.py:1645](https://file+.vscode-resource.vscode-cdn.net/Users/ahuang/repos/sketches/~/repos/hvplot/hvplot/converter.py:1645), in HoloViewsConverter._process_chart_y(self, data, x, y, single_y)
[1643](https://file+.vscode-resource.vscode-cdn.net/Users/ahuang/repos/sketches/~/repos/hvplot/hvplot/converter.py:1643) if len(num_ys) >= 1:
[1644](https://file+.vscode-resource.vscode-cdn.net/Users/ahuang/repos/sketches/~/repos/hvplot/hvplot/converter.py:1644) ys = num_ys
-> [1645](https://file+.vscode-resource.vscode-cdn.net/Users/ahuang/repos/sketches/~/repos/hvplot/hvplot/converter.py:1645) y = ys[0] if len(ys) == 1 or single_y else ys
[1646](https://file+.vscode-resource.vscode-cdn.net/Users/ahuang/repos/sketches/~/repos/hvplot/hvplot/converter.py:1646) return y

IndexError: list index out of range
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.