Python pandas._libs.hashtable.Int64HashTable() Examples
The following are 10
code examples of pandas._libs.hashtable.Int64HashTable().
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._libs.hashtable
, or try the search function
.
Example #1
Source File: sorting.py From recruit with Apache License 2.0 | 6 votes |
def compress_group_index(group_index, sort=True): """ Group_index is offsets into cartesian product of all possible labels. This space can be huge, so this function compresses it, by computing offsets (comp_ids) into the list of unique labels (obs_group_ids). """ size_hint = min(len(group_index), hashtable._SIZE_HINT_LIMIT) table = hashtable.Int64HashTable(size_hint) group_index = ensure_int64(group_index) # note, group labels come out ascending (ie, 1,2,3 etc) comp_ids, obs_group_ids = table.get_labels_groupby(group_index) if sort and len(obs_group_ids) > 0: obs_group_ids, comp_ids = _reorder_by_uniques(obs_group_ids, comp_ids) return comp_ids, obs_group_ids
Example #2
Source File: sorting.py From vnpy_crypto with MIT License | 6 votes |
def compress_group_index(group_index, sort=True): """ Group_index is offsets into cartesian product of all possible labels. This space can be huge, so this function compresses it, by computing offsets (comp_ids) into the list of unique labels (obs_group_ids). """ size_hint = min(len(group_index), hashtable._SIZE_HINT_LIMIT) table = hashtable.Int64HashTable(size_hint) group_index = _ensure_int64(group_index) # note, group labels come out ascending (ie, 1,2,3 etc) comp_ids, obs_group_ids = table.get_labels_groupby(group_index) if sort and len(obs_group_ids) > 0: obs_group_ids, comp_ids = _reorder_by_uniques(obs_group_ids, comp_ids) return comp_ids, obs_group_ids
Example #3
Source File: sorting.py From predictive-maintenance-using-machine-learning with Apache License 2.0 | 6 votes |
def compress_group_index(group_index, sort=True): """ Group_index is offsets into cartesian product of all possible labels. This space can be huge, so this function compresses it, by computing offsets (comp_ids) into the list of unique labels (obs_group_ids). """ size_hint = min(len(group_index), hashtable._SIZE_HINT_LIMIT) table = hashtable.Int64HashTable(size_hint) group_index = ensure_int64(group_index) # note, group labels come out ascending (ie, 1,2,3 etc) comp_ids, obs_group_ids = table.get_labels_groupby(group_index) if sort and len(obs_group_ids) > 0: obs_group_ids, comp_ids = _reorder_by_uniques(obs_group_ids, comp_ids) return comp_ids, obs_group_ids
Example #4
Source File: sorting.py From Splunking-Crime with GNU Affero General Public License v3.0 | 6 votes |
def compress_group_index(group_index, sort=True): """ Group_index is offsets into cartesian product of all possible labels. This space can be huge, so this function compresses it, by computing offsets (comp_ids) into the list of unique labels (obs_group_ids). """ size_hint = min(len(group_index), hashtable._SIZE_HINT_LIMIT) table = hashtable.Int64HashTable(size_hint) group_index = _ensure_int64(group_index) # note, group labels come out ascending (ie, 1,2,3 etc) comp_ids, obs_group_ids = table.get_labels_groupby(group_index) if sort and len(obs_group_ids) > 0: obs_group_ids, comp_ids = _reorder_by_uniques(obs_group_ids, comp_ids) return comp_ids, obs_group_ids
Example #5
Source File: sorting.py From elasticintel with GNU General Public License v3.0 | 6 votes |
def compress_group_index(group_index, sort=True): """ Group_index is offsets into cartesian product of all possible labels. This space can be huge, so this function compresses it, by computing offsets (comp_ids) into the list of unique labels (obs_group_ids). """ size_hint = min(len(group_index), hashtable._SIZE_HINT_LIMIT) table = hashtable.Int64HashTable(size_hint) group_index = _ensure_int64(group_index) # note, group labels come out ascending (ie, 1,2,3 etc) comp_ids, obs_group_ids = table.get_labels_groupby(group_index) if sort and len(obs_group_ids) > 0: obs_group_ids, comp_ids = _reorder_by_uniques(obs_group_ids, comp_ids) return comp_ids, obs_group_ids
Example #6
Source File: sorting.py From recruit with Apache License 2.0 | 5 votes |
def __init__(self, comp_ids, ngroups, levels, labels): self.levels = levels self.labels = labels self.comp_ids = comp_ids.astype(np.int64) self.k = len(labels) self.tables = [hashtable.Int64HashTable(ngroups) for _ in range(self.k)] self._populate_tables()
Example #7
Source File: sorting.py From vnpy_crypto with MIT License | 5 votes |
def __init__(self, comp_ids, ngroups, levels, labels): self.levels = levels self.labels = labels self.comp_ids = comp_ids.astype(np.int64) self.k = len(labels) self.tables = [hashtable.Int64HashTable(ngroups) for _ in range(self.k)] self._populate_tables()
Example #8
Source File: sorting.py From predictive-maintenance-using-machine-learning with Apache License 2.0 | 5 votes |
def __init__(self, comp_ids, ngroups, levels, labels): self.levels = levels self.labels = labels self.comp_ids = comp_ids.astype(np.int64) self.k = len(labels) self.tables = [hashtable.Int64HashTable(ngroups) for _ in range(self.k)] self._populate_tables()
Example #9
Source File: sorting.py From Splunking-Crime with GNU Affero General Public License v3.0 | 5 votes |
def __init__(self, comp_ids, ngroups, levels, labels): self.levels = levels self.labels = labels self.comp_ids = comp_ids.astype(np.int64) self.k = len(labels) self.tables = [hashtable.Int64HashTable(ngroups) for _ in range(self.k)] self._populate_tables()
Example #10
Source File: sorting.py From elasticintel with GNU General Public License v3.0 | 5 votes |
def __init__(self, comp_ids, ngroups, levels, labels): self.levels = levels self.labels = labels self.comp_ids = comp_ids.astype(np.int64) self.k = len(labels) self.tables = [hashtable.Int64HashTable(ngroups) for _ in range(self.k)] self._populate_tables()