Skip to content

Commit da0b51e

Browse files
committed
docstrings
1 parent c9c4d49 commit da0b51e

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

pandas/_libs/parsers.pyx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,6 +2229,16 @@ def _maybe_encode(values):
22292229

22302230
def sanitize_objects(ndarray[object] values, set na_values,
22312231
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+
"""
22322242
cdef:
22332243
Py_ssize_t i, n
22342244
object val, onan

pandas/_libs/writers.pyx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,24 @@ ctypedef fused pandas_string:
2929
@cython.wraparound(False)
3030
def write_csv_rows(list data, ndarray data_index,
3131
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+
"""
3344
cdef int N, j, i, ncols
3445
cdef list rows
3546
cdef object val
3647

3748
# In crude testing, N>100 yields little marginal improvement
38-
N=100
49+
N = 100
3950

4051
# pre-allocate rows
4152
ncols = len(cols)

0 commit comments

Comments
 (0)