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

Issue:
How to apply countDistinct to DataFrameGroupBy
Is there any way to apply `countDistinct` to `DataFrameGroupBy` like the pyspark code below? I've been trying to find a workaround but no luck.

```
# pyspark example 1
sdf.groupBy('x').agg(F.countDistinct('y'))

# pyspark example 2
sdf.groupBy('x').agg(F.expr('count(distinct(y))'))
```


Discussion:
Out of curiosity, is there such way in Pandas?
In Pandas, you can do:
```
df.groupby('x').agg({'y': 'nunique'})
```
or
```
df.groupby('x').agg({'y': lambda s: s.nunique()})
```
https://stackoverflow.com/questions/18554920/pandas-aggregate-count-distinct

Resolving patch:
diff --git a/databricks/koalas/groupby.py b/databricks/koalas/groupby.py
--- a/databricks/koalas/groupby.py
+++ b/databricks/koalas/groupby.py
@@ -105,8 +105,12 @@ def aggregate(self, func_or_funcs, *args, **kwargs):
         groupkeys = self._groupkeys
         groupkey_cols = [s._scol.alias('__index_level_{}__'.format(i))
                          for i, s in enumerate(groupkeys)]
-        reordered = [F.expr('{1}({0}) as {0}'.format(key, value))
-                     for key, value in func_or_funcs.items()]
+        reordered = []
+        for key, value in func_or_funcs.items():
+            if value == "nunique":
+                reordered.append(F.expr('count(DISTINCT {0}) as {0}'.format(key)))
+            else:
+                reordered.append(F.expr('{1}({0}) as {0}'.format(key, value)))
         sdf = sdf.groupby(*groupkey_cols).agg(*reordered)
         internal = _InternalFrame(sdf=sdf,
                                   data_columns=[key for key, _ in func_or_funcs.items()],


Test patch:
diff --git a/databricks/koalas/tests/test_groupby.py b/databricks/koalas/tests/test_groupby.py
--- a/databricks/koalas/tests/test_groupby.py
+++ b/databricks/koalas/tests/test_groupby.py
@@ -113,6 +113,14 @@ def test_raises(self):
         self.assertRaises(KeyError, lambda: kdf.groupby('a')['b', 'x'])
         self.assertRaises(KeyError, lambda: kdf.groupby('a')[['b', 'x']])
 
+    def test_nunique(self):
+        pdf = pd.DataFrame({'a': [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
+                            'b': [2, 2, 2, 3, 3, 4, 4, 5, 5, 5]})
+        kdf = koalas.DataFrame(pdf)
+
+        self.assert_eq(kdf.groupby("a").agg({"b": "nunique"}),
+                       pdf.groupby("a").agg({"b": "nunique"}))
+
     def test_missing(self):
         kdf = koalas.DataFrame({'a': [1, 2, 3, 4, 5, 6, 7, 8, 9]})
Repository: databricks/koalas

Issue:
Unexpected behavior in ks.merge how='outer'
Hi,

I have been trying to perform a outer join between two koalas dataframes on basis of a column, but am getting very unexpected results. Below is an example,

`left_kdf = ks.DataFrame({'A': [1, 2]})`
`right_kdf = ks.DataFrame({'B': ['x', 'y', 'z'], 'A':[3, 4, 1]})`
`left_kdf.merge(right_kdf, on=["A"], how='outer')`

The output that I get is 

![image](https://user-images.githubusercontent.com/11263917/60987332-16bab200-a361-11e9-8566-8ae4f4e53bce.png)

However, if this is a SQL style join as said in the documentation, the output should be something like,
 
![image](https://user-images.githubusercontent.com/11263917/60987566-95175400-a361-11e9-9ee1-8fbb0d55f90e.png)

The None part (in Column B) is discussed in [#263](https://github.com/databricks/koalas/issues/263)

What concerns me are the missing values in column A.


Discussion:

Resolving patch:
diff --git a/databricks/koalas/frame.py b/databricks/koalas/frame.py
--- a/databricks/koalas/frame.py
+++ b/databricks/koalas/frame.py
@@ -4659,7 +4659,13 @@ def merge(self, right: 'DataFrame', how: str = 'inner',
             scol = scol_for(left_table, col)
             if col in duplicate_columns:
                 if col in left_keys and col in right_keys:
-                    pass
+                    right_scol = scol_for(right_table, col)
+                    if how == 'right':
+                        scol = right_scol
+                    elif how == 'full':
+                        scol = F.when(scol.isNotNull(), scol).otherwise(right_scol).alias(col)
+                    else:
+                        pass
                 else:
                     col = col + left_suffix
                     scol = scol.alias(col)


Test patch:
diff --git a/databricks/koalas/tests/test_dataframe.py b/databricks/koalas/tests/test_dataframe.py
--- a/databricks/koalas/tests/test_dataframe.py
+++ b/databricks/koalas/tests/test_dataframe.py
@@ -591,6 +591,7 @@ def check(op):
 
         # join types
         for how in ['inner', 'left', 'right', 'outer']:
+            check(lambda left, right: left.merge(right, on='value', how=how))
             check(lambda left, right: left.merge(right, left_on='lkey', right_on='rkey', how=how))
 
         # suffix
Repository: databricks/koalas

Issue:
Implement DataFrame.style
Seems pandas support `style` property
I should research Pandas' and implement it in Koalas


Discussion:

Resolving patch:
diff --git a/databricks/koalas/frame.py b/databricks/koalas/frame.py
--- a/databricks/koalas/frame.py
+++ b/databricks/koalas/frame.py
@@ -1626,6 +1626,28 @@ def empty(self):
         """
         return len(self._internal.data_columns) == 0 or self._sdf.rdd.isEmpty()
 
+    @property
+    def style(self):
+        """
+        Property returning a Styler object containing methods for
+        building a styled HTML representation fo the DataFrame.
+
+        .. note:: currently it collects top 1000 rows and return its
+            pandas `pandas.io.formats.style.Styler` instance.
+
+        Examples
+        --------
+        >>> ks.range(1001).style  # doctest: +ELLIPSIS
+        <pandas.io.formats.style.Styler object at ...>
+        """
+        # TODO: Add a configuration to control the limit
+        max_results = 1000
+        pdf = self.head(max_results + 1).to_pandas()
+        if len(pdf) > max_results:
+            warnings.warn(
+                "'style' property will only use top %s rows." % max_results, UserWarning)
+        return pdf.head(max_results).style
+
     def set_index(self, keys, drop=True, append=False, inplace=False):
         """Set the DataFrame index (row labels) using one or more existing columns.
 
diff --git a/databricks/koalas/missing/frame.py b/databricks/koalas/missing/frame.py
--- a/databricks/koalas/missing/frame.py
+++ b/databricks/koalas/missing/frame.py
@@ -33,7 +33,6 @@ class _MissingPandasLikeDataFrame(object):
     axes = unsupported_property('axes')
     iat = unsupported_property('iat')
     ndim = unsupported_property('ndim')
-    style = unsupported_property('style')
 
     # Deprecated properties
     blocks = unsupported_property('blocks', deprecated=True)


Test patch:
Repository: databricks/koalas

Issue:
[DO NOT MERGE] Test



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -45,7 +45,7 @@
     },
     python_requires='>=3.5',
     install_requires=[
-        'pandas>=0.23',
+        'pandas>=0.23.2',
         'pyarrow>=0.10',
         'numpy>=1.14',
         'matplotlib>=3.0.0',


Test patch:
Repository: databricks/koalas

Issue:
Add "sep" parameter for read_csv
I'd like to read in a tab-delimited CSV file. In pandas and in Spark, I can specify sep="\t", but in Koalas it isn't supported. Could you please add support for this?


Discussion:
Can I work on this?
@harupy Sure, please go ahead. Thanks!

Resolving patch:
diff --git a/databricks/koalas/namespace.py b/databricks/koalas/namespace.py
--- a/databricks/koalas/namespace.py
+++ b/databricks/koalas/namespace.py
@@ -123,7 +123,7 @@ def range(start: int,
     return DataFrame(sdf)
 
 
-def read_csv(path, header='infer', names=None, usecols=None,
+def read_csv(path, sep=',', header='infer', names=None, usecols=None,
              mangle_dupe_cols=True, parse_dates=False, comment=None):
     """Read CSV (comma-separated) file into DataFrame.
 
@@ -131,6 +131,8 @@ def read_csv(path, header='infer', names=None, usecols=None,
     ----------
     path : str
         The path string storing the CSV file to be read.
+    sep : str, default ‘,’
+        Delimeter to use. Must be a single character.
     header : int, list of int, default ‘infer’
         Whether to to use as the column names, and the start of the data.
         Default behavior is to infer the column names: if no names are passed
@@ -181,6 +183,7 @@ def read_csv(path, header='infer', names=None, usecols=None,
         usecols = list(usecols)
     if usecols is None or callable(usecols) or len(usecols) > 0:
         reader = default_session().read.option("inferSchema", "true")
+        reader.option("sep", sep)
 
         if header == 'infer':
             header = 0 if names is None else None


Test patch:
diff --git a/databricks/koalas/tests/test_csv.py b/databricks/koalas/tests/test_csv.py
--- a/databricks/koalas/tests/test_csv.py
+++ b/databricks/koalas/tests/test_csv.py
@@ -80,6 +80,16 @@ def csv_text_with_comments(self):
             # footer
             """ % self.csv_text)
 
+    @property
+    def tab_delimited_csv_text(self):
+        return normalize_text(
+            """
+            name\tamount
+            Alice\t100
+            Bob\t-200
+            Charlie\t300
+            """)
+
     @contextmanager
     def csv_file(self, csv):
         with self.temp_file() as tmp:
@@ -152,6 +162,12 @@ def test_read_csv_with_comment(self):
             self.assertRaisesRegex(ValueError, 'Only length-1 comment characters supported',
                                    lambda: ks.read_csv(fn, comment=[1]))
 
+    def test_read_csv_with_sep(self):
+        with self.csv_file(self.tab_delimited_csv_text) as fn:
+            expected = pd.read_csv(fn, sep='\t')
+            actual = ks.read_csv(fn, sep='\t')
+            self.assertPandasAlmostEqual(expected, actual.toPandas())
+
     def test_read_csv_with_mangle_dupe_cols(self):
         self.assertRaisesRegex(ValueError, 'mangle_dupe_cols',
                                lambda: ks.read_csv('path', mangle_dupe_cols=False))
Repository: databricks/koalas

Issue:
Pandas read_csv(squeeze='True') to enable koalas Series and not Dataframe
Would be extremely useful to directly read in a koalas.Series from read_csv and not have to convert Dataframe to Series (which also does not exist in Koalas). 
Thank you!


Discussion:
@ueshin  I am working on this one. 

Resolving patch:
diff --git a/databricks/koalas/namespace.py b/databricks/koalas/namespace.py
--- a/databricks/koalas/namespace.py
+++ b/databricks/koalas/namespace.py
@@ -125,7 +125,8 @@ def range(start: int,
 
 
 def read_csv(path, sep=',', header='infer', names=None, index_col=None,
-             usecols=None, mangle_dupe_cols=True, parse_dates=False, comment=None):
+             usecols=None, squeeze=False, mangle_dupe_cols=True,
+             parse_dates=False, comment=None):
     """Read CSV (comma-separated) file into DataFrame.
 
     Parameters
@@ -155,6 +156,8 @@ def read_csv(path, sep=',', header='infer', names=None, index_col=None,
         from the document header row(s).
         If callable, the callable function will be evaluated against the column names,
         returning names where the callable function evaluates to `True`.
+    squeeze : bool, default False
+        If the parsed data only contains one column then return a Series.
     mangle_dupe_cols : bool, default True
         Duplicate columns will be specified as 'X0', 'X1', ... 'XN', rather
         than 'X' ... 'X'. Passing in False will cause data to be overwritten if
@@ -246,8 +249,11 @@ def read_csv(path, sep=',', header='infer', names=None, index_col=None,
         sdf = default_session().createDataFrame([], schema=StructType())
 
     index_map = _get_index_map(sdf, index_col)
+    kdf = DataFrame(_InternalFrame(sdf=sdf, index_map=index_map))
 
-    return DataFrame(_InternalFrame(sdf=sdf, index_map=index_map))
+    if squeeze and len(kdf.columns) == 1:
+        return kdf[kdf.columns[0]]
+    return kdf
 
 
 def read_json(path: str, index_col: Optional[Union[str, List[str]]] = None, **options):


Test patch:
diff --git a/databricks/koalas/tests/test_csv.py b/databricks/koalas/tests/test_csv.py
--- a/databricks/koalas/tests/test_csv.py
+++ b/databricks/koalas/tests/test_csv.py
@@ -173,6 +173,16 @@ def test_read_csv_with_sep(self):
             actual = ks.read_csv(fn, sep='\t')
             self.assertPandasAlmostEqual(expected, actual.toPandas())
 
+    def test_read_csv_with_squeeze(self):
+        with self.csv_file(self.csv_text) as fn:
+            expected = pd.read_csv(fn, squeeze=True, usecols=['name'])
+            actual = ks.read_csv(fn, squeeze=True, usecols=['name'])
+            self.assertPandasAlmostEqual(expected, actual.toPandas())
+
+            expected = pd.read_csv(fn, squeeze=True, usecols=['name', 'amount'])
+            actual = ks.read_csv(fn, squeeze=True, usecols=['name', 'amount'])
+            self.assertPandasAlmostEqual(expected, actual.toPandas())
+
     def test_read_csv_with_mangle_dupe_cols(self):
         self.assertRaisesRegex(ValueError, 'mangle_dupe_cols',
                                lambda: ks.read_csv('path', mangle_dupe_cols=False))
Repository: databricks/koalas

Issue:
Raise error for duplicate columns in join
```python
df = ks.DataFrame([['a', 1,'dog'], ['b', 2,'cat']],
                    columns=['letter', 'number','animal'])
s1 = ks.Series(['a', 'e'],index=[0,1],name='letter')
df.join(s1, how='outer')
```
The above code will raise  the following error.
```python
>>> AnalysisException: "Reference 'letter' is ambiguous, could be: letter, letter.;"
```
In `pandas` it will raise the following error which is more helpful. 
```python
>>> ValueError: columns overlap but no suffix specified: ['letter']
``


Discussion:

Resolving patch:
diff --git a/databricks/koalas/frame.py b/databricks/koalas/frame.py
--- a/databricks/koalas/frame.py
+++ b/databricks/koalas/frame.py
@@ -5433,6 +5433,14 @@ def join(self, right: 'DataFrame', on: Optional[Union[str, List[str]]] = None,
         2  K1  A1    B1
         3  K2  A2    B2
         """
+        if isinstance(right, ks.Series):
+            common = list(self.columns.intersection([right.name]))
+        else:
+            common = list(self.columns.intersection(right.columns))
+        if len(common) > 0 and not lsuffix and not rsuffix:
+            raise ValueError(
+                "columns overlap but no suffix specified: "
+                "{rename}".format(rename=common))
         if on:
             self = self.set_index(on)
             join_kdf = self.merge(right, left_index=True, right_index=True, how=how,


Test patch:
diff --git a/databricks/koalas/tests/test_dataframe.py b/databricks/koalas/tests/test_dataframe.py
--- a/databricks/koalas/tests/test_dataframe.py
+++ b/databricks/koalas/tests/test_dataframe.py
@@ -1001,6 +1001,7 @@ def test_join(self):
                              'A': ['A0', 'A1', 'A2', 'A3']}, columns=['key', 'A'])
         kdf2 = ks.DataFrame({'key': ['K0', 'K1', 'K2'],
                              'B': ['B0', 'B1', 'B2']}, columns=['key', 'B'])
+        ks1 = ks.Series(['A1', 'A5'], index=[1, 2], name='A')
         join_pdf = pdf1.join(pdf2, lsuffix='_left', rsuffix='_right')
         join_pdf.sort_values(by=list(join_pdf.columns), inplace=True)
 
@@ -1009,6 +1010,11 @@ def test_join(self):
 
         self.assert_eq(join_pdf, join_kdf)
 
+        # join with duplicated columns in Series and DataFrame
+        with self.assertRaisesRegex(ValueError,
+                                    "columns overlap but no suffix specified"):
+            kdf1.join(ks1, how='outer')
+            kdf1.join(kdf2, how='outer')
         # check `on` parameter
         join_pdf = pdf1.join(pdf2.set_index('key'), on='key', lsuffix='_left', rsuffix='_right')
         join_pdf.sort_values(by=list(join_pdf.columns), inplace=True)
Repository: databricks/koalas

Issue:
Some parameters in plot.py are surrounded by backticks
Some parameters in `plot.py` are surrounded by backticks. Should they be removed?

<img width="760" alt="Screen Shot 2019-10-05 at 15 33 03" src="https://user-images.githubusercontent.com/17039389/66251007-8df7ba80-e785-11e9-8563-ee3575d9a1f2.png">

---

The code corresponding to the fig above

```
    def bar(self, **kwds):
        """
        Vertical bar plot.
        Parameters
        ----------
        `**kwds` : optional
            Additional keyword arguments are documented in
            :meth:`Koalas.Series.plot`.
```


Discussion:
@harupy, are you interested in submitting a PR?

Resolving patch:
diff --git a/databricks/koalas/plot.py b/databricks/koalas/plot.py
--- a/databricks/koalas/plot.py
+++ b/databricks/koalas/plot.py
@@ -746,7 +746,7 @@ def plot_series(data, kind='line', ax=None,                    # Series unique
     mark_right : boolean, default True
         When using a secondary_y axis, automatically mark the column
         labels with "(right)" in the legend
-    `**kwds` : keywords
+    **kwds : keywords
         Options to pass to matplotlib plotting method
 
     Returns
@@ -875,7 +875,7 @@ def plot_frame(data, x=None, y=None, kind='line', ax=None,
         labels with "(right)" in the legend
     sort_columns: bool, default is False
         When True, will sort values on plots.
-    `**kwds` : keywords
+    **kwds : keywords
         Options to pass to matplotlib plotting method
 
     Returns
@@ -1011,7 +1011,7 @@ def bar(self, **kwds):
 
         Parameters
         ----------
-        `**kwds` : optional
+        **kwds : optional
             Additional keyword arguments are documented in
             :meth:`Koalas.Series.plot`.
 
@@ -1074,11 +1074,11 @@ def box(self, **kwds):
 
         Parameters
         ----------
-        `**kwds` : optional
+        **kwds : optional
             Additional keyword arguments are documented in
             :meth:`Koalas.Series.plot`.
 
-        `precision`: scalar, default = 0.01
+        precision: scalar, default = 0.01
             This argument is used by Koalas to compute approximate statistics
             for building a boxplot. Use *smaller* values to get more precise
             statistics.
@@ -1121,7 +1121,7 @@ def hist(self, bins=10, **kwds):
         ----------
         bins : integer, default 10
             Number of histogram bins to be used
-        `**kwds` : optional
+        **kwds : optional
             Additional keyword arguments are documented in
             :meth:`Koalas.Series.plot`.
 
@@ -1511,7 +1511,7 @@ def bar(self, x=None, y=None, **kwds):
         y : label or position, optional
             Allows plotting of one column versus another.
             If not specified, all numerical columns are used.
-        `**kwds` : optional
+        **kwds : optional
             Additional keyword arguments are documented in
             :meth:`Koalas.DataFrame.plot`.
 


Test patch:
Repository: databricks/koalas

Issue:
is_monotonic_decreasing & is_monotonic_increasing for index not work properly
When we use `is_monotonic_decreasing` or `is_monotonic_increasing` for index,

pandas works like below:

```python
>>> s = pd.Series([7, 6, 5, 4, 3, 2, 1], index=[7, 6, 5, 4, 3, 2, 1])
>>> s.index.is_monotonic_decreasing
True
```
Since the index order is literally motononic decreasing, they return `True`

But our case,

```python
>>> s = ks.Series([7, 6, 5, 4, 3, 2, 1], index=[7, 6, 5, 4, 3, 2, 1])
>>> s.index.is_monotonic_decreasing
False
```

as seen above, it returns `False`.

because our existing logic always order by index column before calculate the each rows increasing or decreasing.

So they always calculate result based on data column, not index column. (index column is always sorted since order by)

So i think maybe it is better to fix this logic to follow behavior of pandas one for index.


Discussion:

Resolving patch:
diff --git a/databricks/koalas/base.py b/databricks/koalas/base.py
--- a/databricks/koalas/base.py
+++ b/databricks/koalas/base.py
@@ -27,6 +27,7 @@
 from pyspark import sql as spark
 from pyspark.sql import functions as F, Window
 from pyspark.sql.types import DoubleType, FloatType, LongType, StringType, TimestampType
+from pyspark.sql.functions import monotonically_increasing_id
 
 from databricks import koalas as ks  # For running doctests and reference resolution in PyCharm.
 from databricks.koalas.internal import _InternalFrame
@@ -299,9 +300,16 @@ def is_monotonic(self):
 
         >>> ser.rename("a").to_frame().set_index("a").index.is_monotonic
         True
+
+        >>> ser = ks.Series([5, 4, 3, 2, 1], index=[1, 2, 3, 4, 5])
+        >>> ser.is_monotonic
+        False
+
+        >>> ser.index.is_monotonic
+        True
         """
         col = self._scol
-        window = Window.orderBy(self._kdf._internal.index_scols).rowsBetween(-1, -1)
+        window = Window.orderBy(monotonically_increasing_id()).rowsBetween(-1, -1)
         return self._with_new_scol((col >= F.lag(col, 1).over(window)) & col.isNotNull()).all()
 
     is_monotonic_increasing = is_monotonic
@@ -343,9 +351,16 @@ def is_monotonic_decreasing(self):
 
         >>> ser.rename("a").to_frame().set_index("a").index.is_monotonic_decreasing
         True
+
+        >>> ser = ks.Series([5, 4, 3, 2, 1], index=[1, 2, 3, 4, 5])
+        >>> ser.is_monotonic_decreasing
+        True
+
+        >>> ser.index.is_monotonic_decreasing
+        False
         """
         col = self._scol
-        window = Window.orderBy(self._kdf._internal.index_scols).rowsBetween(-1, -1)
+        window = Window.orderBy(monotonically_increasing_id()).rowsBetween(-1, -1)
         return self._with_new_scol((col <= F.lag(col, 1).over(window)) & col.isNotNull()).all()
 
     def astype(self, dtype):


Test patch:
Repository: databricks/koalas

Issue:
MultiIndex.from_tuples
```Python
df = ks.DataFrame(
    {"a" : [4 ,5, 6],
     "b" : [7, 8, 9],
     "c" : [10, 11, 12]},
index = ks.MultiIndex.from_tuples(
    [('d',1),('d',2),('e',2)],
       names=['n','v']))
```

Due to the missing MultiIndex.from_tuples, it returns the following error:
```
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-19-ba2ef765a723> in <module>
      3 "b" : [7, 8, 9],
      4 "c" : [10, 11, 12]},
----> 5 index = ks.MultiIndex.from_tuples(
      6 [('d',1),('d',2),('e',2)],
      7 names=['n','v']))

AttributeError: type object 'MultiIndex' has no attribute 'from_tuples'
```


Discussion:
I'm working on this.

Resolving patch:
diff --git a/databricks/koalas/indexes.py b/databricks/koalas/indexes.py
--- a/databricks/koalas/indexes.py
+++ b/databricks/koalas/indexes.py
@@ -472,6 +472,39 @@ def any(self, *args, **kwargs):
     def all(self, *args, **kwargs):
         raise TypeError("cannot perform all with this index type: MultiIndex")
 
+    @staticmethod
+    def from_tuples(tuples, sortorder=None, names=None):
+        """
+        Convert list of tuples to MultiIndex.
+
+        Parameters
+        ----------
+        tuples : list / sequence of tuple-likes
+            Each tuple is the index of one row/column.
+        sortorder : int or None
+            Level of sortedness (must be lexicographically sorted by that level).
+        names : list / sequence of str, optional
+            Names for the levels in the index.
+
+        Returns
+        -------
+        index : MultiIndex
+
+        Examples
+        --------
+
+        >>> tuples = [(1, 'red'), (1, 'blue'),
+        ...           (2, 'red'), (2, 'blue')]
+        >>> ks.MultiIndex.from_tuples(tuples, names=('number', 'color'))  # doctest: +SKIP
+        MultiIndex([(1,  'red'),
+                    (1, 'blue'),
+                    (2,  'red'),
+                    (2, 'blue')],
+                   names=['number', 'color'])
+        """
+        return DataFrame(index=pd.MultiIndex.from_tuples(
+            tuples=tuples, sortorder=sortorder, names=names)).index
+
     @property
     def name(self) -> str:
         raise PandasNotImplementedError(class_name='pd.MultiIndex', property_name='name')


Test patch: