diff --git a/pandas/_libs/parsers.pyx b/pandas/_libs/parsers.pyx index 3a42a64046abd..4f7d75e0aaad6 100644 --- a/pandas/_libs/parsers.pyx +++ b/pandas/_libs/parsers.pyx @@ -1596,8 +1596,6 @@ cdef _categorical_convert(parser_t *parser, int64_t col, cdef _to_fw_string(parser_t *parser, int64_t col, int64_t line_start, int64_t line_end, int64_t width): cdef: - Py_ssize_t i - coliter_t it const char *word = NULL char *data ndarray result @@ -1642,15 +1640,11 @@ cdef _try_double(parser_t *parser, int64_t col, bint na_filter, kh_str_starts_t *na_hashset, object na_flist): cdef: int error, na_count = 0 - Py_ssize_t i, lines - coliter_t it - const char *word = NULL - char *p_end + Py_ssize_t lines float64_t *data float64_t NA = na_values[np.float64] kh_float64_t *na_fset ndarray result - khiter_t k bint use_na_flist = len(na_flist) > 0 lines = line_end - line_start @@ -1685,7 +1679,7 @@ cdef inline int _try_double_nogil(parser_t *parser, coliter_t it const char *word = NULL char *p_end - khiter_t k, k64 + khiter_t k64 na_count[0] = 0 coliter_setup(&it, parser, col, line_start) @@ -1748,11 +1742,10 @@ cdef _try_uint64(parser_t *parser, int64_t col, bint na_filter, kh_str_starts_t *na_hashset): cdef: int error - Py_ssize_t i, lines + Py_ssize_t lines coliter_t it uint64_t *data ndarray result - khiter_t k uint_state state lines = line_end - line_start @@ -1822,13 +1815,11 @@ cdef _try_int64(parser_t *parser, int64_t col, bint na_filter, kh_str_starts_t *na_hashset): cdef: int error, na_count = 0 - Py_ssize_t i, lines + Py_ssize_t lines coliter_t it int64_t *data ndarray result - int64_t NA = na_values[np.int64] - khiter_t k lines = line_end - line_start result = np.empty(lines, dtype=np.int64) @@ -1856,7 +1847,6 @@ cdef inline int _try_int64_nogil(parser_t *parser, int64_t col, Py_ssize_t i, lines = line_end - line_start coliter_t it const char *word = NULL - khiter_t k na_count[0] = 0 coliter_setup(&it, parser, col, line_start) @@ -1892,9 +1882,7 @@ cdef _try_bool_flex(parser_t *parser, int64_t col, const kh_str_starts_t *false_hashset): cdef: int error, na_count = 0 - Py_ssize_t i, lines - coliter_t it - const char *word = NULL + Py_ssize_t lines uint8_t *data ndarray result @@ -1926,7 +1914,6 @@ cdef inline int _try_bool_flex_nogil(parser_t *parser, int64_t col, Py_ssize_t i, lines = line_end - line_start coliter_t it const char *word = NULL - khiter_t k na_count[0] = 0 coliter_setup(&it, parser, col, line_start) @@ -1981,10 +1968,8 @@ cdef kh_str_starts_t* kset_from_list(list values) except NULL: # caller takes responsibility for freeing the hash table cdef: Py_ssize_t i - khiter_t k kh_str_starts_t *table int ret = 0 - object val table = kh_init_str_starts() @@ -2012,7 +1997,6 @@ cdef kh_str_starts_t* kset_from_list(list values) except NULL: cdef kh_float64_t* kset_float64_from_list(values) except NULL: # caller takes responsibility for freeing the hash table cdef: - Py_ssize_t i khiter_t k kh_float64_t *table int ret = 0 @@ -2150,7 +2134,6 @@ cdef _apply_converter(object f, parser_t *parser, int64_t col, int64_t line_start, int64_t line_end, char* c_encoding): cdef: - int error Py_ssize_t i, lines coliter_t it const char *word = NULL