Skip to content

Commit

Permalink
Add docstring and change sorting in join function for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
reidy-p committed Jan 12, 2019
1 parent 3cd7ed5 commit f393803
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ def item_from_zerodim(val: object) -> object:
@cython.wraparound(False)
@cython.boundscheck(False)
def fast_unique_multiple(list arrays, sort: bool=True):
"""
Generate a list of unique values from a list of arrays.
Parameters
----------
list : array-like
A list of array-like objects
sort : boolean
Whether or not to sort the resulting unique list
Returns
-------
unique_list : list of unique values
"""
cdef:
ndarray[object] buf
Py_ssize_t k = len(arrays)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3244,9 +3244,9 @@ def join(self, other, how='left', level=None, return_indexers=False,
elif how == 'right':
join_index = other
elif how == 'inner':
join_index = self.intersection(other, sort=sort)
join_index = self.intersection(other, sort=False)
elif how == 'outer':
join_index = self.union(other, sort=sort)
join_index = self.union(other)

if sort:
join_index = join_index.sort_values()
Expand Down

0 comments on commit f393803

Please sign in to comment.