internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: dask/dask

Issue:
Encoding issues in dask.bag
This will raise an exception in decode sequence that the `'ascii'` codec can't decode some character. This is because the data is unicode.

``` python
In [1]: ! wget wget http://data.githubarchive.org/2015-01-01-15.json.gz
...

In [2]: import dask.bag as db; import json

In [3]: a = db.from_filenames('2015-01-01-15.json.gz').map(json.loads)

In [4]: a.pluck('type').compute()
```



Discussion:
Here is a better test

``` python
import dask.bag as db
from dask.utils import tmpfile
def test_gh715():
    data = 'ákåðiæ¶'
    with tmpfile() as fn:
        with open(fn, 'w') as f:
            f.write(data)
        a = db.from_filenames(fn)
        a.compute()
```


Resolving patch:
diff --git a/dask/bag/core.py b/dask/bag/core.py
--- a/dask/bag/core.py
+++ b/dask/bag/core.py
@@ -39,6 +39,8 @@
 load_names = ('load-%d' % i for i in itertools.count(1))
 
 system_encoding = getdefaultencoding()
+if system_encoding == 'ascii':
+    system_encoding = 'utf-8'
 
 no_default = '__no__default__'
 


Test patch:
diff --git a/dask/bag/tests/test_bag.py b/dask/bag/tests/test_bag.py
--- a/dask/bag/tests/test_bag.py
+++ b/dask/bag/tests/test_bag.py
@@ -10,7 +10,8 @@
 import math
 from dask.bag.core import (Bag, lazify, lazify_task, fuse, map, collect,
         reduceby, bz2_stream, stream_decompress, reify, partition,
-        _parse_s3_URI, inline_singleton_lists, optimize, decode_sequence)
+        _parse_s3_URI, inline_singleton_lists, optimize, decode_sequence,
+        system_encoding)
 from dask.utils import filetexts, tmpfile, raises
 from dask.async import get_sync
 import dask
@@ -24,8 +25,6 @@
 
 from collections import Iterator
 
-system_encoding = getdefaultencoding()
-
 dsk = {('x', 0): (range, 5),
        ('x', 1): (range, 5),
        ('x', 2): (range, 5)}
@@ -678,6 +677,7 @@ def setter(d):
             return d
         return self.map(setter)
 
+
 def test_bag_class_extend():
     dictbag = BagOfDicts(*db.from_sequence([{'a': {'b': 'c'}}])._args)
     assert dictbag.get('a').get('b').compute()[0] == 'c'
@@ -685,3 +685,11 @@ def test_bag_class_extend():
         {'b': 'c', 'd': 'EXTENSIBILITY!!!'}
     assert isinstance(dictbag.get('a').get('b'), BagOfDicts)
 
+
+def test_gh715():
+    bin_data = u'\u20ac'.encode('utf-8')
+    with tmpfile() as fn:
+        with open(fn, 'wb') as f:
+            f.write(bin_data)
+        a = db.from_filenames(fn)
+        assert a.compute()[0] == bin_data.decode('utf-8')
Repository: dask/dask

Issue:
read_csv: passing index_col results in KeyError
Sample data:

```
"id1","id2","attr1","attr2","attr3","attr4"
1072.0,"2014-02-22 12:30:00",1,93440248,"False",750
1072.0,"2014-02-22 12:45:00",1,93440248,"False",765
1072.0,"2014-02-22 13:00:00",1,93440248,"False",780
1072.0,"2014-02-22 13:15:00",1,93440248,"False",795
```

The following results in a `KeyError` (full stack trace on [pastebin.com](http://pastebin.com/nx1zBQA7)):

``` python
dask_df = dd.read_csv('test.csv',  index_col='id1')
```

However, setting the index column using the `set_index` method works (e.g. as follows) for single-columned indexes ([MultiIndexes](http://pandas.pydata.org/pandas-docs/stable/advanced.html) are not yet supported in Dask).

``` python
dask_df = dd.read_csv('test.csv')
dask_df = dask_df.set_index('id1')
```

Issue detected when using Dask 0.7.1 and pandas 0.16.2.



Discussion:
Indexes have to be a bit more strange when working in parallel.  I think that, for the moment we should just raise an informative error pointing people to use `set_index` explicitly.


Resolving patch:
diff --git a/dask/dataframe/io.py b/dask/dataframe/io.py
--- a/dask/dataframe/io.py
+++ b/dask/dataframe/io.py
@@ -91,6 +91,14 @@ def fill_kwargs(fn, args, kwargs):
     kwargs: dict
         keyword arguments to give to pd.read_csv
     """
+
+    if 'index_col' in kwargs:
+        msg = """
+        The index column cannot be set at dataframe creation time. Instead use
+        the `set_index` method on the dataframe after it is created.
+        """
+        raise ValueError(msg)
+
     kwargs = merge(csv_defaults, kwargs)
     sample_nrows = kwargs.pop('sample_nrows', 1000)
     essentials = ['columns', 'names', 'header', 'parse_dates', 'dtype']


Test patch:
diff --git a/dask/dataframe/tests/test_io.py b/dask/dataframe/tests/test_io.py
--- a/dask/dataframe/tests/test_io.py
+++ b/dask/dataframe/tests/test_io.py
@@ -712,3 +712,12 @@ def test_hdf_globbing():
         tm.assert_frame_equal(res.compute(), pd.concat([df] *  3))
     finally:
         shutil.rmtree(tdir)
+
+
+def test_index_col():
+    with filetext(text) as fn:
+        try:
+            f = read_csv(fn, chunkbytes=30, index_col='name')
+            assert False
+        except ValueError as e:
+            assert 'set_index' in str(e)
Repository: dask/dask

Issue:
Create docpage about how to use async scheduler
There are various options and flags that are pretty handy in non-trivial use.  Currently the only documentation is more research-y.  It would be good to have a doc page that was about “How to run the thing you just made” (feedback from @seibert)



Discussion:
To add some more information here: The main thing that was lacking was some page that showed some simple examples of how to execute the dask graph that was created with different schedulers and different options to those schedulers.


Resolving patch:
diff --git a/dask/threaded.py b/dask/threaded.py
--- a/dask/threaded.py
+++ b/dask/threaded.py
@@ -29,7 +29,7 @@ def get(dsk, result, cache=None, num_workers=None, **kwargs):
         A dask dictionary specifying a workflow
     result: key or list of keys
         Keys corresponding to desired data
-    nthreads: integer of thread count
+    num_workers: integer of thread count
         The number of threads to use in the ThreadPool that will actually execute tasks
     cache: dict-like (optional)
         Temporary storage of results
diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -92,9 +92,14 @@
 
 # -- Options for HTML output ---------------------------------------------------
 
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-html_theme = 'default'
+# Taken from docs.readthedocs.org:
+# on_rtd is whether we are on readthedocs.org
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+if not on_rtd:  # only import and set the theme if we're building docs locally
+    import sphinx_rtd_theme
+    html_theme = 'sphinx_rtd_theme'
+    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the


Test patch:
Repository: dask/dask

Issue:
Wrapping RandomState.choice raises numpy dependency to 1.7
scikit-image depends on dask, but has a minimum requirement of numpy 1.6.1.  Dask trying to wrap RandomState.choice moves that dependency up to 1.7.



Discussion:

Resolving patch:
diff --git a/dask/array/random.py b/dask/array/random.py
--- a/dask/array/random.py
+++ b/dask/array/random.py
@@ -4,7 +4,7 @@
 from itertools import product
 from .core import normalize_chunks, Array
 from ..base import tokenize
-from ..utils import different_seeds
+from ..utils import different_seeds, ignoring
 
 def doc_wraps(func):
     """ Copy docstring from one function to another """
@@ -82,10 +82,11 @@ def chisquare(self, df, size=None, chunks=None):
         return self._wrap(np.random.RandomState.chisquare, df,
                          size=size, chunks=chunks)
 
-    @doc_wraps(np.random.RandomState.choice)
-    def choice(self, a, size=None, replace=True, p=None, chunks=None):
-        return self._wrap(np.random.RandomState.choice, a,
-                         size=size, replace=True, p=None, chunks=chunks)
+    with ignoring(AttributeError):
+        @doc_wraps(np.random.RandomState.choice)
+        def choice(self, a, size=None, replace=True, p=None, chunks=None):
+            return self._wrap(np.random.RandomState.choice, a,
+                             size=size, replace=True, p=None, chunks=chunks)
 
     # @doc_wraps(np.random.RandomState.dirichlet)
     # def dirichlet(self, alpha, size=None, chunks=None):


Test patch:
Repository: dask/dask

Issue:
Add drop_duplicates' subset kwarg for parity with pandas
Adding this makes the `Distinct` expression in blaze work easily. This came up while working on adding dask.dataframe to blaze in [this PR](https://github.com/blaze/blaze/pull/1317). This should be pretty easy.

Relevent blaze code:
https://github.com/blaze/blaze/blob/master/blaze/compute/pandas.py#L216

Relevant dask code:
https://github.com/blaze/dask/blob/master/dask/dataframe/core.py#L244

Pandas API reference:
http://pandas.pydata.org/pandas-docs/version/0.17.0/generated/pandas.DataFrame.drop_duplicates.html



Discussion:
Agreed that this should be pretty easy.  I think you can probably just pass through the argument directly to the per-partition functions.

I'll do this in about an hour if no one beats me too it first.


Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -241,8 +241,9 @@ def cache(self, cache=Cache):
         return self._constructor(dsk2, name, self.column_info, self.divisions)
 
     @derived_from(pd.DataFrame)
-    def drop_duplicates(self):
-        chunk = lambda s: s.drop_duplicates()
+    def drop_duplicates(self, **kwargs):
+        assert all(k in ('keep', 'subset', 'take_last') for k in kwargs)
+        chunk = lambda s: s.drop_duplicates(**kwargs)
         return aca(self, chunk=chunk, aggregate=chunk, columns=self.column_info,
                    token='drop-duplicates')
 
@@ -1522,6 +1523,7 @@ def apply(self, func, axis=0, args=(), columns=no_default, **kwds):
                               False, False, None, args, **kwds)
 
 
+
 # bind operators
 for op in [operator.abs, operator.add, operator.and_, operator_div,
            operator.eq, operator.gt, operator.ge, operator.inv,


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -1222,6 +1222,25 @@ def test_drop_duplicates():
     assert eq(d.index.drop_duplicates(), full.index.drop_duplicates())
 
 
+def test_drop_duplicates_subset():
+    df = pd.DataFrame({'x': [1, 2, 3, 1, 2, 3],
+                       'y': ['a', 'a', 'b', 'b', 'c', 'c']})
+    ddf = dd.from_pandas(df, npartitions=2)
+
+    if pd.__version__ < '0.17':
+        kwargs = [{'take_last': False}, {'take_last': True}]
+    else:
+        kwargs = [{'keep': 'first'}, {'keep': 'last'}]
+
+
+    for kwarg in kwargs:
+        assert eq(df.x.drop_duplicates(**kwarg),
+                  ddf.x.drop_duplicates(**kwarg))
+        for ss in [['x'], 'y', ['x', 'y']]:
+            assert eq(df.drop_duplicates(subset=ss, **kwarg),
+                      ddf.drop_duplicates(subset=ss, **kwarg))
+
+
 def test_full_groupby():
     assert raises(Exception, lambda: d.groupby('does_not_exist'))
     assert raises(Exception, lambda: d.groupby('a').does_not_exist)
Repository: dask/dask

Issue:
Delta memory usage in memory profiler
In the memory profiler, would it make sense to subtract off the initial memory usage when the context manager is initialized?

In the below screenshot, I'm running the profiler after doing other things in the notebook, and I'm only interested in the delta memory usage (~120 MB here), similar to the delta memory usage reported by [ipython_memwatcher](https://github.com/FrancescAlted/ipython_memwatcher).

<img width="792" alt="screen shot 2015-11-19 at 10 15 31 pm" src="https://cloud.githubusercontent.com/assets/303236/11291841/110f6210-8f0b-11e5-8823-d1d85e18ac0e.png">



Discussion:
This seems useful to me.  An alternative (though not necessarily better) approach would be to keep the numbers as they are, but change the default plotting range.


Resolving patch:
diff --git a/dask/diagnostics/profile_visualize.py b/dask/diagnostics/profile_visualize.py
--- a/dask/diagnostics/profile_visualize.py
+++ b/dask/diagnostics/profile_visualize.py
@@ -306,7 +306,8 @@ def plot_resources(results, palette='GnBu', **kwargs):
     colors = brewer[palette][6]
     p.line(t, cpu, color=colors[0], line_width=4, legend='% CPU')
     p.yaxis.axis_label = "% CPU"
-    p.extra_y_ranges = {'memory': Range1d(start=0, end=(max(mem) if mem else 100))}
+    p.extra_y_ranges = {'memory': Range1d(start=(min(mem) if mem else 0),
+                                          end=(max(mem) if mem else 100))}
     p.line(t, mem, color=colors[2], y_range_name='memory', line_width=4,
            legend='Memory')
     p.add_layout(LinearAxis(y_range_name='memory', axis_label='Memory (MB)'),


Test patch:
Repository: dask/dask

Issue:
Is dask.dataframe.sample with replacement?
Hi dask team, 

Is this method random sampling with replacement or without replacement? http://dask.pydata.org/en/latest/dataframe-api.html#dask.dataframe.core.DataFrame.sample

Thanks,
Yuan



Discussion:

Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -467,13 +467,15 @@ def fillna(self, value):
         func = getattr(self._partition_type, 'fillna')
         return map_partitions(func, self.column_info, self, value)
 
-    def sample(self, frac, random_state=None):
+    def sample(self, frac, replace=False, random_state=None):
         """ Random sample of items
 
         Parameters
         ----------
         frac : float, optional
             Fraction of axis items to return.
+        replace: boolean, optional
+            Sample with or without replacement. Default = False.
         random_state: int or np.random.RandomState
             If int create a new RandomState with this as the seed
         Otherwise draw from the passed RandomState
@@ -487,14 +489,15 @@ def sample(self, frac, random_state=None):
         if random_state is None:
             random_state = np.random.randint(np.iinfo(np.int32).max)
 
-        name = 'sample-' + tokenize(self, frac, random_state)
+        name = 'sample-' + tokenize(self, frac, replace, random_state)
         func = getattr(self._partition_type, 'sample')
 
         seeds = different_seeds(self.npartitions, random_state)
 
         dsk = dict(((name, i),
                    (apply, func, (tuple, [(self._name, i)]),
-                       {'frac': frac, 'random_state': seed}))
+                       {'frac': frac, 'random_state': seed,
+                        'replace': replace}))
                    for i, seed in zip(range(self.npartitions), seeds))
 
         return self._constructor(merge(self.dask, dsk), name,


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -2156,6 +2156,15 @@ def test_sample():
     assert a.sample(0.5)._name != a.sample(0.5)._name
 
 
+def test_sample_without_replacement():
+    df = pd.DataFrame({'x': [1, 2, 3, 4, None, 6], 'y': list('abdabd')},
+                      index=[10, 20, 30, 40, 50, 60])
+    a = dd.from_pandas(df, 2)
+    b = a.sample(0.7, replace=False)
+    bb = b.index.compute()
+    assert len(bb) == len(set(bb))
+
+
 def test_datetime_accessor():
     df = pd.DataFrame({'x': [1, 2, 3, 4]})
     df['x'] = df.x.astype('M8[us]')
Repository: dask/dask

Issue:
broadcast_chunks fails when first chunk is (1,)
It seems that dask.array.core.broadcast_chunks fails with when first chunk in input is (1,), even when they are identical. For example 

``` python
>>> broadcast_chunks(((2,), (2, 2),), ((2,), (2, 2),))
((2,), (2, 2))
```

but

``` python
>>> broadcast_chunks(((1,), (2, 2),), ((1,), (2, 2),))
ValueError: Chunks do not align: []
```

The cause is on line 604 in array/core.py:

``` python
step2 = [c for c in step1 if c != (1,)]
```

Why the `if c != (1,)`?



Discussion:
This is intended to support [numpy-style broadcasting rules](http://docs.scipy.org/doc/numpy-1.10.1/user/basics.broadcasting.html#general-broadcasting-rules) between arrays with different numbers of dimensions.  It looks like we fail in the case where all arrays actually have a singleton dimension.  

This looks like a genuine bug to me.


Resolving patch:
diff --git a/dask/array/core.py b/dask/array/core.py
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -601,7 +601,10 @@ def broadcast_chunks(*chunkss):
     result = []
     for i in range(n):
         step1 = [c[i] for c in chunkss2]
-        step2 = [c for c in step1 if c != (1,)]
+        if all(c == (1,) for c in step1):
+            step2 = step1
+        else:
+            step2 = [c for c in step1 if c != (1,)]
         if len(set(step2)) != 1:
             raise ValueError("Chunks do not align: %s" % str(step2))
         result.append(step2[0])


Test patch:
diff --git a/dask/array/tests/test_array_core.py b/dask/array/tests/test_array_core.py
--- a/dask/array/tests/test_array_core.py
+++ b/dask/array/tests/test_array_core.py
@@ -1734,6 +1734,10 @@ def test_broadcast_chunks():
     with pytest.raises(ValueError):
         broadcast_chunks(a, b)
 
+    a = ((1,), (5, 5),)
+    b = ((1,), (5, 5),)
+    assert broadcast_chunks(a, b) == a
+
 
 def test_chunks_error():
     x = np.ones((10, 10))
Repository: dask/dask

Issue:
BUG: dask.array errors on timedelta64 arithmetic
```
da.from_array(np.array([np.timedelta64(10, 'h')]), chunks=(1,)) / np.timedelta64(1, 'h')
```

```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-19-38c05cd03730> in <module>()
----> 1 da.from_array(np.array([np.timedelta64(10, 'h')]), chunks=(1,)) / np.timedelta64(1, 'h')

/export/data/dask/dask/array/core.pyc in __div__(self, other)
   1044         return elemwise(operator.and_, other, self)
   1045     def __div__(self, other):
-> 1046         return elemwise(operator.div, self, other)
   1047     def __rdiv__(self, other):
   1048         return elemwise(operator.div, other, self)

/export/data/dask/dask/array/core.pyc in elemwise(op, *args, **kwargs)
   2085 
   2086     if other:
-> 2087         op2 = partial_by_order(op, other)
   2088     else:
   2089         op2 = op

/export/data/dask/dask/array/core.pyc in partial_by_order(op, other)
   1979     else:
   1980         other_arg = '...'
-> 1981     f.__name__ = '{0}({1})'.format(op.__name__, other_arg)
   1982     return f
   1983 

TypeError: don't know how to convert scalar number to long
```



Discussion:

Resolving patch:
diff --git a/dask/array/core.py b/dask/array/core.py
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -1998,7 +1998,7 @@ def f(*args):
         other_arg = other[0][1]
     else:
         other_arg = '...'
-    f.__name__ = '{0}({1})'.format(op.__name__, other_arg)
+    f.__name__ = '{0}({1})'.format(op.__name__, str(other_arg))
     return f
 
 


Test patch:
diff --git a/dask/array/tests/test_array_core.py b/dask/array/tests/test_array_core.py
--- a/dask/array/tests/test_array_core.py
+++ b/dask/array/tests/test_array_core.py
@@ -1766,3 +1766,10 @@ def test_dont_dealias_outputs():
 
     a = da.Array(dsk, 'x', chunks=(2, 2), shape=(4, 4))
     eq(a, np.ones((4, 4)))
+
+
+def test_timedelta_op():
+    x = np.array([np.timedelta64(10, 'h')])
+    y = np.timedelta64(1, 'h')
+    a = da.from_array(x, chunks=(1,)) / y
+    assert a.compute() == x / y
Repository: dask/dask

Issue:
.map is acting on the partition index, rather than the values
```
In [27]: s = Series([-100,-50,0,50,100],index=list('ABCDE'))

In [28]: sm = Series(list('ABCAB'),list('ABCDE'))

In [29]: sm.map(s)
Out[29]: 
A   -100
B    -50
C      0
D   -100
E    -50
dtype: int64

In [30]: ddf.from_pandas(sm,npartitions=5).compute()                                         
Out[30]: 
A    A
B    B
C    C
D    A
E    B
dtype: object

In [31]: ddf.from_pandas(sm,npartitions=5).map(s)   
Out[31]: dd.Series<elemwise-b533b55a33e686222d4aafe30c2f6c9e, divisions=('A', 'B', 'C', 'D', 'E')>

In [32]: ddf.from_pandas(sm,npartitions=5).map(s).compute()
Out[32]: 
A   -100
B    -50
C      0
D    NaN
E    NaN
dtype: float64
```

so [32] should be equiv [29]



Discussion:

Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1132,7 +1132,14 @@ def isin(self, other):
 
     @derived_from(pd.Series)
     def map(self, arg, na_action=None):
-        return elemwise(pd.Series.map, self, arg, na_action)
+        if not (isinstance(arg, (pd.Series, dict)) or callable(arg)):
+            raise TypeError("arg must be pandas.Series, dict or callable."
+                            " Got {0}".format(type(arg)))
+        name = 'map-' + tokenize(self, arg, na_action)
+        dsk = dict(((name, i), (pd.Series.map, k, arg, na_action)) for i, k in
+                   enumerate(self._keys()))
+        dsk.update(self.dask)
+        return Series(dsk, name, self.name, self.divisions)
 
     @derived_from(pd.Series)
     def astype(self, dtype):


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -679,6 +679,13 @@ def test_assign():
 
 def test_map():
     assert eq(d.a.map(lambda x: x + 1), full.a.map(lambda x: x + 1))
+    lk = dict((v, v + 1) for v in full.a.values)
+    assert eq(d.a.map(lk), full.a.map(lk))
+    assert eq(d.b.map(lk), full.b.map(lk))
+    lk = pd.Series(lk)
+    assert eq(d.a.map(lk), full.a.map(lk))
+    assert eq(d.b.map(lk), full.b.map(lk))
+    assert raises(TypeError, lambda: d.a.map(d.b))
 
 
 def test_concat():
Repository: dask/dask

Issue:
Isin with series return partial results 
Hello everyone, 

Here is my first contribution to Github, thank you all for sharing those wonderful works. 

Today I used dask isin like df[df.x.isin(y)].compute() but y was not a list but a pandas series. The result is not an error, but a partial result (not all rows), so it's very confusing. 

dask version 0.7.6 pandas version 17.1 with winpython 3.5.1.2

Best regards 



Discussion:

Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1100,7 +1100,7 @@ def nlargest(self, n=5):
 
     @derived_from(pd.Series)
     def isin(self, other):
-        return elemwise(pd.Series.isin, self, other)
+        return elemwise(pd.Series.isin, self, list(other))
 
     @derived_from(pd.Series)
     def map(self, arg, na_action=None):


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -499,6 +499,8 @@ def test_unique():
 
 def test_isin():
     assert eq(d.a.isin([0, 1, 2]), full.a.isin([0, 1, 2]))
+    assert eq(d.a.isin(pd.Series([0, 1, 2])),
+              full.a.isin(pd.Series([0, 1, 2])))
 
 
 def test_len():