Skip to content

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

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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