Skip to content

Commit 71d89f2

Browse files
committed
upgraded doc-ststring; added some blank lines
1 parent fa7a043 commit 71d89f2

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

pandas/_libs/lib.pyx

+14-9
Original file line numberDiff line numberDiff line change
@@ -2357,26 +2357,27 @@ cdef cnp.ndarray[object] _concat_date_cols_numpy(tuple date_cols,
23572357
Py_ssize_t col_count,
23582358
bint keep_trivial_numbers):
23592359
"""
2360-
Concatenates `rows_count` elements from each `col_count` numpy arrays
2361-
in `date_cols` into strings.
2362-
2363-
Note
2364-
----
2365-
This function speeds up concatenation for numpy arrays.
2366-
You also can use `_concat_date_cols_sequence` function.
2360+
Concatenates elements from numpy arrays into strings.
23672361
23682362
Parameters
23692363
----------
23702364
date_cols : tuple of numpy arrays
23712365
rows_count : Py_ssize_t
2366+
count of elements from arrays that will be concatenated
23722367
col_count : Py_ssize_t
2368+
count of arrays whose elements will be concatenated
23732369
keep_trivial_numbers : bool, default False
23742370
if True and len(date_cols) == 1, then
23752371
conversion (to string from integer/float zero) is not performed
23762372
23772373
Returns
23782374
-------
23792375
arr_of_rows : ndarray (dtype=object)
2376+
2377+
Notes
2378+
-----
2379+
This function speeds up concatenation for numpy arrays.
2380+
You also can use `_concat_date_cols_sequence` function.
23802381
"""
23812382
cdef:
23822383
Py_ssize_t col_idx, row_idx
@@ -2402,11 +2403,13 @@ cdef cnp.ndarray[object] _concat_date_cols_numpy(tuple date_cols,
24022403
# create fixed size list - more effecient memory allocation
24032404
list_to_join = [None] * col_count
24042405
iters = np.zeros(col_count, dtype=object)
2406+
24052407
# create memoryview of iters ndarray, that will contain some
24062408
# flatiter's for each array in `date_cols` - more effecient indexing
24072409
iters_view = iters
24082410
for col_idx, array in enumerate(date_cols):
24092411
iters_view[col_idx] = PyArray_IterNew(array)
2412+
24102413
# array elements that are on the same line are converted to one string
24112414
for row_idx in range(rows_count):
24122415
for col_idx, array in enumerate(date_cols):
@@ -2428,14 +2431,15 @@ cdef cnp.ndarray[object] _concat_date_cols_sequence(tuple date_cols,
24282431
Py_ssize_t col_count,
24292432
bint keep_trivial_numbers):
24302433
"""
2431-
Concatenates `rows_count` elements from each `col_count` sequences
2432-
in `date_cols` into strings.
2434+
Concatenates elements from sequences into strings.
24332435
24342436
Parameters
24352437
----------
24362438
date_cols : tuple of sequences
24372439
rows_count : Py_ssize_t
2440+
count of elements from sequences that will be concatenated
24382441
col_count : Py_ssize_t
2442+
count of sequences whose elements will be concatenated
24392443
keep_trivial_numbers : bool, default False
24402444
if True and len(date_cols) == 1, then
24412445
conversion (to string from integer/float zero) is not performed
@@ -2451,6 +2455,7 @@ cdef cnp.ndarray[object] _concat_date_cols_sequence(tuple date_cols,
24512455
object[:] result_view
24522456

24532457
result = np.zeros(rows_count, dtype=object)
2458+
24542459
# create memoryview of result ndarray - more effecient indexing
24552460
result_view = result
24562461

0 commit comments

Comments
 (0)