File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -2229,6 +2229,16 @@ def _maybe_encode(values):
2229
2229
2230
2230
def sanitize_objects (ndarray[object] values , set na_values ,
2231
2231
convert_empty = True ):
2232
+ """
2233
+ Convert specified values, including the given set na_values and empty
2234
+ strings if convert_empty is True, to np.nan.
2235
+
2236
+ Parameters
2237
+ ----------
2238
+ values : ndarray[object]
2239
+ na_values : set
2240
+ convert_empty : bool (default True)
2241
+ """
2232
2242
cdef:
2233
2243
Py_ssize_t i, n
2234
2244
object val, onan
Original file line number Diff line number Diff line change @@ -29,13 +29,24 @@ ctypedef fused pandas_string:
29
29
@ cython.wraparound (False )
30
30
def write_csv_rows (list data , ndarray data_index ,
31
31
int nlevels , ndarray cols , object writer ):
32
-
32
+ """
33
+ Write the given data to the writer object, pre-allocating where possible
34
+ for performance improvements.
35
+
36
+ Parameters
37
+ ----------
38
+ data : list
39
+ data_index : ndarray
40
+ nlevels : int
41
+ cols : ndarray
42
+ writer : object
43
+ """
33
44
cdef int N, j, i, ncols
34
45
cdef list rows
35
46
cdef object val
36
47
37
48
# In crude testing, N>100 yields little marginal improvement
38
- N= 100
49
+ N = 100
39
50
40
51
# pre-allocate rows
41
52
ncols = len (cols)
You can’t perform that action at this time.
0 commit comments