holoviz / holoviz/datashader

Make Canvas.points directly work on two-column numpy.ndarray

Open
#992 0 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

My data are numpy arrays of the form `source = numpy.random.randint(0,9,size=(30000,2))`

I would like to use
```python
ds.Canvas().points(source)
```
, but this gives the error
```
Point coordinates may be specified by providing both the x and y arguments, or by
providing the geometry argument. Received:
x: None
y: None
geometry: None
```

My first workaround attempt was
``` python
ds.Canvas().points(pd.DataFrame(source), x=0, y=1)
```
, but this gives another error: `TypeError: dimension 1 is not a string`

So this is my ugly workaround:
``` python
ds.Canvas().points(pd.DataFrame(source, columns=['x', 'y']), x='x', y='y')
```

(I am using datashader 0.12.0.)

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.