Python pandas.core.sorting.get_group_index() Examples

The following are 5 code examples of pandas.core.sorting.get_group_index(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.core.sorting , or try the search function .
Example #1
Source File: multi.py    From recruit with Apache License 2.0 5 votes vote down vote up
def duplicated(self, keep='first'):
        from pandas.core.sorting import get_group_index
        from pandas._libs.hashtable import duplicated_int64

        shape = map(len, self.levels)
        ids = get_group_index(self.codes, shape, sort=False, xnull=False)

        return duplicated_int64(ids, keep) 
Example #2
Source File: multi.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def duplicated(self, keep='first'):
        from pandas.core.sorting import get_group_index
        from pandas._libs.hashtable import duplicated_int64

        shape = map(len, self.levels)
        ids = get_group_index(self.labels, shape, sort=False, xnull=False)

        return duplicated_int64(ids, keep) 
Example #3
Source File: multi.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def duplicated(self, keep='first'):
        from pandas.core.sorting import get_group_index
        from pandas._libs.hashtable import duplicated_int64

        shape = map(len, self.levels)
        ids = get_group_index(self.codes, shape, sort=False, xnull=False)

        return duplicated_int64(ids, keep) 
Example #4
Source File: multi.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def duplicated(self, keep='first'):
        from pandas.core.sorting import get_group_index
        from pandas._libs.hashtable import duplicated_int64

        shape = map(len, self.levels)
        ids = get_group_index(self.labels, shape, sort=False, xnull=False)

        return duplicated_int64(ids, keep) 
Example #5
Source File: multi.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def duplicated(self, keep='first'):
        from pandas.core.sorting import get_group_index
        from pandas._libs.hashtable import duplicated_int64

        shape = map(len, self.levels)
        ids = get_group_index(self.labels, shape, sort=False, xnull=False)

        return duplicated_int64(ids, keep)