Skip to content

Commit db5c447

Browse files
author
tp
committed
add Int8HashTable
1 parent 436a429 commit db5c447

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

pandas/_libs/hashtable.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ from libc.stdlib cimport malloc, free
1111

1212
import numpy as np
1313
cimport numpy as cnp
14-
from numpy cimport ndarray, uint8_t, uint32_t
14+
from numpy cimport ndarray, int8_t, uint8_t, uint32_t
1515
cnp.import_array()
1616

1717
cdef extern from "numpy/npy_math.h":

pandas/_libs/hashtable_class_helper.pxi.in

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in
1818

1919
dtypes = [('Float64', 'float64', 'float64_t'),
2020
('Int64', 'int64', 'int64_t'),
21+
('Int8', 'int8', 'int8_t'),
2122
('String', 'string', 'char *'),
2223
('UInt64', 'uint64', 'uint64_t')]
2324
}}
@@ -62,7 +63,9 @@ cdef inline bint needs_resize(vector_data *data) nogil:
6263
# name, dtype, arg, idtype
6364
dtypes = [('Float64', 'float64', 'float64_t', 'np.float64'),
6465
('UInt64', 'uint64', 'uint64_t', 'np.uint64'),
65-
('Int64', 'int64', 'int64_t', 'np.int64')]
66+
('Int64', 'int64', 'int64_t', 'np.int64'),
67+
('Int8', 'int8', 'int8_t', 'np.int8'),
68+
]
6669

6770
}}
6871

@@ -251,7 +254,9 @@ cdef class HashTable:
251254
# name, dtype, float_group, default_na_value
252255
dtypes = [('Float64', 'float64', True, 'nan'),
253256
('UInt64', 'uint64', False, 0),
254-
('Int64', 'int64', False, 'iNaT')]
257+
('Int64', 'int64', False, 'iNaT'),
258+
('Int8', 'int8', False, 'iNaT'),
259+
]
255260

256261
def get_dispatch(dtypes):
257262
for (name, dtype, float_group, default_na_value) in dtypes:

pandas/_libs/khash.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# cython: profile=False
33
from cpython cimport PyObject
4-
from numpy cimport int64_t, uint64_t, int32_t, uint32_t, float64_t
4+
from numpy cimport int64_t, uint64_t, int32_t, uint32_t, int8_t, float64_t
55

66
cdef extern from "khash_python.h":
77
ctypedef uint32_t khint_t

0 commit comments

Comments
 (0)