Skip to content

Cannot yield Numpy arrays or Pandas data frames. Truth value is ambiguous #1

@thomas-maschler

Description

@thomas-maschler

When i try to yield a Numpy array or Pandas data frame from a Stage I get an error.
It sais, the truth of Array or DataFrame is ambiguous. Use a.any() or a.all().

I can type cast results as normal list, and it works. Any chance there is a way to catch this error?

import numpy as np
from parallelpipe import stage

@stage()
def myfunc(prod):
    for i in prod:
        yield np.asarray(i)

prod = [[1,2],[2,3],[3,4]]
pipe = prod | myfunc()

for array in pipe.results():
    print(array)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions