[Paraview] numpy_interface/dataset_adapter append method fails on string datatypes ?

Dean Neumann dwneumann at gmail.com
Fri Jul 1 21:46:23 EDT 2016


I am trying to write a python programmable filter which calculates
statistics across multiple input datasets and outputs those as a vtkTable.

All is ok for numeric values.   But I can't seem to get any approach to
work for outputting a vtkTable column of string values.
Using numpy_interface/dataset_adapter.py is the cleanest approach I've yet
tried for appending  columns of numeric values to an output dataset of type
vtkTable, but it raises the following error on string-valued arrays:

> Traceback (most recent call last):

File "<string>", line 29, in <module>

File "<string>", line 14, in RequestData

File "C:\Program
> Files\ParaView\lib\paraview-5.0\site-packages\vtk\numpy_interface\dataset_adapter.py",
> line 648, in append

narray = narray * numpy.ones(arrLength)

TypeError: only integer arrays with one element can be converted to an index


Can someone please post an example python programmable filter that outputs
a vtkTable which includes a column of string valued data?   I have attached
a minimal script which reproduces the problem.


Thanks....

Dean Neumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160701/b0deb728/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: numpy_fail.py
Type: application/octet-stream
Size: 593 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160701/b0deb728/attachment.obj>


More information about the ParaView mailing list