rbc icon indicating copy to clipboard operation
rbc copied to clipboard

`ColumnList` as a matrix

Open tupui opened this issue 3 years ago • 0 comments

It would be handy to be able access rows of multiple columns when indexing. This would allow to have a familiar interface for NumPy-like users.

@omnisci('UDTF(ColumnList<float>, OutputColumn<float>)')
def fahrenheit2celsius(inp, out):
    size = inp.size
    set_output_row_size(size)
    for i in range(size):
        out[i] = (array_api.mean(inp[i]) - 32) * 5 / 9
    return size

Here is the current error.

E                   numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
E                   No implementation of function Function(<function _omnisci_array_mean at 0x108afa670>) found for signature:
E                    
E                    >>> _omnisci_array_mean(float32*)
E                    
E                   There are 2 candidate implementations:
E                       - Of which 2 did not match due to:
E                       Overload of function '_omnisci_array_mean': File: ../../../../../../../../../../Users/tupui/Documents/Quansight/Projects/Omnisci/rbc/rbc/stdlib/statistical_functions.py: Line 121.
E                         With argument(s): '(float32*)':
E                        No match.
E                   
E                   During: resolving callee type: Function(<function _omnisci_array_mean at 0x108afa670>)
E                   During: typing of call at /Users/tupui/Documents/Quansight/Projects/Omnisci/rbc/rbc/tests/test_TUTORIAL.py (278)
E                   
E                   
E                   File "test_TUTORIAL.py", line 278:
E                       def fahrenheit2celsius(inp, out):
E                           <source elided>
E                           for i in range(size):
E                               out[i] = (array_api.mean(inp[i]) - 32) * 5 / 9
E                               ^

tupui avatar Mar 02 '22 15:03 tupui