Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPython Parallel map mysteriously turns pandas Series into numpy ndarray #3519

Closed
samuela opened this issue Jul 3, 2013 · 2 comments
Closed
Milestone

Comments

@samuela
Copy link
Contributor

samuela commented Jul 3, 2013

If you run

from IPython.parallel import Client
c = Client()
v = c[:]

with v.sync_imports():
    from pandas import Series
    import numpy as np

poop = v.map(lambda x: Series({'a': x}), range(5))
[type(x) for x in poop]

The result is

[numpy.ndarray,
 numpy.ndarray,
 numpy.ndarray,
 numpy.ndarray,
 numpy.ndarray]

Whereas running

poop = [Series({'a': x}) for x in range(5)]
[type(x) for x in poop]

returns

[pandas.core.series.Series,
 pandas.core.series.Series,
 pandas.core.series.Series,
 pandas.core.series.Series,
 pandas.core.series.Series]

as expected.

@minrk
Copy link
Member

minrk commented Jul 3, 2013

Yes, a known bug due to an inappropriate use of isinstance, since Series is a subclass of ndarray. This is fixed a while back in master, when I rewrote the parallel serialization.

@minrk minrk closed this as completed Jul 3, 2013
@samuela
Copy link
Contributor Author

samuela commented Jul 6, 2013

Great, thanks!

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

No branches or pull requests

2 participants