<div dir="ltr">I am trying to write a python programmable filter which calculates statistics across multiple input datasets and outputs those as a vtkTable.<div><br></div><div>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. </div><div>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:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="color:rgb(128,0,0);font-family:Courier;font-size:8.25pt">Traceback (most recent call last):</span> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="color:rgb(128,0,0);font-family:Courier;font-size:8.25pt">File "<string>", line 29, in <module></span> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="color:rgb(128,0,0);font-family:Courier;font-size:8.25pt">File "<string>", line 14, in RequestData</span> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="color:rgb(128,0,0);font-family:Courier;font-size:8.25pt">File "C:\Program Files\ParaView\lib\paraview-5.0\site-packages\vtk\numpy_interface\dataset_adapter.py", line 648, in append</span> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="color:rgb(128,0,0);font-family:Courier;font-size:8.25pt">narray = narray * numpy.ones(arrLength)</span> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="color:rgb(128,0,0);font-family:Courier;font-size:8.25pt">TypeError: only integer arrays with one element can be converted to an index</span></blockquote>
<p style="margin:0px;font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)"><br></p><p style="margin:0px;font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)">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.</p><p style="margin:0px;font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)"><br></p><p style="margin:0px;font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)">Thanks....</p><p style="margin:0px;font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)">Dean Neumann</p></div>