We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following fails:
import pandas as pd import numpy as np from IPython.parallel import Client c = Client() v = c[:] v.map_sync(lambda x: x, np.arange(101))
with the error
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-6-71ded66ea5e0> in <module>() ----> 1 X, Y, index = get_XY(indicators, ticker='DIA', balance=False) /Users/samuelainsworth/Development/Finance Research/suspicious_classifier.py in get_XY(indicators, ticker, lamb, balance, verbose) 154 ### Buys 155 # Collect features for all buys and associate with dates --> 156 buy_features = zip(buys, v.map_sync(collect_features, buys)) 157 158 # drop examples where we don't features /usr/local/lib/python2.7/site-packages/IPython/parallel/client/view.pyc in map_sync(self, f, *sequences, **kwargs) 365 raise TypeError("map_sync doesn't take a `block` keyword argument.") 366 kwargs['block'] = True --> 367 return self.map(f,*sequences,**kwargs) 368 369 def imap(self, f, *sequences, **kwargs): /usr/local/lib/python2.7/site-packages/IPython/parallel/client/view.pyc in map(self, f, *sequences, **kwargs) /usr/local/lib/python2.7/site-packages/IPython/parallel/client/view.pyc in sync_results(f, self, *args, **kwargs) 61 self._in_sync_results = True 62 try: ---> 63 ret = f(self, *args, **kwargs) 64 finally: 65 self._in_sync_results = False /usr/local/lib/python2.7/site-packages/IPython/parallel/client/view.pyc in map(self, f, *sequences, **kwargs) 613 assert len(sequences) > 0, "must have some sequences to map onto!" 614 pf = ParallelFunction(self, f, block=block, **kwargs) --> 615 return pf.map(*sequences) 616 617 @sync_results /usr/local/lib/python2.7/site-packages/IPython/parallel/client/remotefunction.pyc in map(self, *sequences) 275 self._mapping = True 276 try: --> 277 ret = self(*sequences) 278 finally: 279 self._mapping = False /usr/local/lib/python2.7/site-packages/IPython/parallel/client/remotefunction.pyc in __call__(self, *sequences) /usr/local/lib/python2.7/site-packages/IPython/parallel/client/remotefunction.pyc in sync_view_results(f, self, *args, **kwargs) 89 view = self.view 90 if view._in_sync_results: ---> 91 return f(self, *args, **kwargs) 92 print 'in sync results', f 93 view._in_sync_results = True /usr/local/lib/python2.7/site-packages/IPython/parallel/client/remotefunction.pyc in __call__(self, *sequences) 233 part = self.mapObject.getPartition(seq, index, nparts, maxlen) 234 args.append(part) --> 235 if not any(args): 236 continue 237 ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
The text was updated successfully, but these errors were encountered:
04aa452
Backport PR ipython#4021: Fix parallel.client.View map() on numpy arrays
ffed22c
Resolves ipython#4020.
Merge pull request ipython#4021 from samuela/master
af6862f
Fix parallel.client.View map() on numpy arrays closes ipython#4020
Successfully merging a pull request may close this issue.
The following fails:
with the error
The text was updated successfully, but these errors were encountered: