<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 2, 2017, at 5:50 AM, Giuseppe Falcone <<a href="mailto:falcone.giuseppe@gmail.com" class="">falcone.giuseppe@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi to all,<div class=""><br class=""></div><div class="">I have a pipe that elaborate a las file. on the pipe.arrays[0] command I have, as result, a ndarray.<br class=""></div><div class="">I want to split this array in twa subarray: the first with element that have ReturnNumber dimension = 1 and the second with all others elements.</div><div class=""><br class=""></div><div class="">There is an efficient way to do this?</div></div></div></blockquote><br class=""></div><div>numpy.where is probably the cleanest way to do this purely in python <a href="https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.where.html" class="">https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.where.html</a></div><div><br class=""></div><div><blockquote type="cite" class=""><div>return_nos = pipe.arrays[0]['ReturnNumber']</div><div>firsts = np.where(return_nos < 2)</div></blockquote><div class=""><div><br class=""></div></div><div>Another way would be to write a pipeline with two readers.las, two filters.range, and a filters.merge. Both readers.las would read the same file, and each filters.range would define the range [1] of ReturnNumber you wanted in each set. Then you would use a filters.merge to bring them back together into two separate arrays. This approach is less than ideal due to the fact that you end up reading the same file twice.</div><div><br class=""></div><div>Howard</div><div><br class=""></div><div>[1] <a href="https://www.pdal.io/stages/filters.range.html#ranges" class="">https://www.pdal.io/stages/filters.range.html#ranges</a></div></div></body></html>