1
1
# Copyright (c) 2012, Lambda Foundry, Inc.
2
2
# See LICENSE for the license
3
- from base64 import decode
4
3
from collections import defaultdict
5
4
from csv import (
6
5
QUOTE_MINIMAL,
7
6
QUOTE_NONE,
8
7
QUOTE_NONNUMERIC,
9
8
)
10
- from errno import ENOENT
11
- import inspect
12
9
import sys
13
10
import time
14
11
import warnings
@@ -24,10 +21,7 @@ from pandas.core.arrays import (
24
21
)
25
22
26
23
cimport cython
27
- from cpython.bytes cimport (
28
- PyBytes_AsString,
29
- PyBytes_FromString,
30
- )
24
+ from cpython.bytes cimport PyBytes_AsString
31
25
from cpython.exc cimport (
32
26
PyErr_Fetch,
33
27
PyErr_Occurred,
@@ -631,7 +625,7 @@ cdef class TextReader:
631
625
cdef:
632
626
Py_ssize_t i, start, field_count, passed_count, unnamed_count, level
633
627
char * word
634
- str name, old_name
628
+ str name
635
629
uint64_t hr, data_line = 0
636
630
list header = []
637
631
set unnamed_cols = set ()
@@ -939,7 +933,7 @@ cdef class TextReader:
939
933
object name , na_flist , col_dtype = None
940
934
bint na_filter = 0
941
935
int64_t num_cols
942
- dict result
936
+ dict results
943
937
bint use_nullable_dtypes
944
938
945
939
start = self .parser_start
@@ -1461,7 +1455,7 @@ cdef _string_box_utf8(parser_t *parser, int64_t col,
1461
1455
bint na_filter, kh_str_starts_t * na_hashset,
1462
1456
const char * encoding_errors):
1463
1457
cdef:
1464
- int error, na_count = 0
1458
+ int na_count = 0
1465
1459
Py_ssize_t i, lines
1466
1460
coliter_t it
1467
1461
const char * word = NULL
@@ -1517,16 +1511,14 @@ cdef _categorical_convert(parser_t *parser, int64_t col,
1517
1511
" Convert column data into codes, categories"
1518
1512
cdef:
1519
1513
int na_count = 0
1520
- Py_ssize_t i, size, lines
1514
+ Py_ssize_t i, lines
1521
1515
coliter_t it
1522
1516
const char * word = NULL
1523
1517
1524
1518
int64_t NA = - 1
1525
1519
int64_t[::1 ] codes
1526
1520
int64_t current_category = 0
1527
1521
1528
- char * errors = " strict"
1529
-
1530
1522
int ret = 0
1531
1523
kh_str_t * table
1532
1524
khiter_t k
@@ -1972,7 +1964,6 @@ cdef kh_str_starts_t* kset_from_list(list values) except NULL:
1972
1964
cdef kh_float64_t* kset_float64_from_list(values) except NULL :
1973
1965
# caller takes responsibility for freeing the hash table
1974
1966
cdef:
1975
- khiter_t k
1976
1967
kh_float64_t * table
1977
1968
int ret = 0
1978
1969
float64_t val
@@ -1983,7 +1974,7 @@ cdef kh_float64_t* kset_float64_from_list(values) except NULL:
1983
1974
for value in values:
1984
1975
val = float (value)
1985
1976
1986
- k = kh_put_float64(table, val, & ret)
1977
+ kh_put_float64(table, val, & ret)
1987
1978
1988
1979
if table.n_buckets <= 128 :
1989
1980
# See reasoning in kset_from_list
0 commit comments