@@ -2357,26 +2357,27 @@ cdef cnp.ndarray[object] _concat_date_cols_numpy(tuple date_cols,
2357
2357
Py_ssize_t col_count,
2358
2358
bint keep_trivial_numbers):
2359
2359
"""
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.
2367
2361
2368
2362
Parameters
2369
2363
----------
2370
2364
date_cols : tuple of numpy arrays
2371
2365
rows_count : Py_ssize_t
2366
+ count of elements from arrays that will be concatenated
2372
2367
col_count : Py_ssize_t
2368
+ count of arrays whose elements will be concatenated
2373
2369
keep_trivial_numbers : bool, default False
2374
2370
if True and len(date_cols) == 1, then
2375
2371
conversion (to string from integer/float zero) is not performed
2376
2372
2377
2373
Returns
2378
2374
-------
2379
2375
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.
2380
2381
"""
2381
2382
cdef:
2382
2383
Py_ssize_t col_idx, row_idx
@@ -2402,11 +2403,13 @@ cdef cnp.ndarray[object] _concat_date_cols_numpy(tuple date_cols,
2402
2403
# create fixed size list - more effecient memory allocation
2403
2404
list_to_join = [None ] * col_count
2404
2405
iters = np.zeros(col_count, dtype = object )
2406
+
2405
2407
# create memoryview of iters ndarray, that will contain some
2406
2408
# flatiter's for each array in `date_cols` - more effecient indexing
2407
2409
iters_view = iters
2408
2410
for col_idx, array in enumerate (date_cols):
2409
2411
iters_view[col_idx] = PyArray_IterNew(array)
2412
+
2410
2413
# array elements that are on the same line are converted to one string
2411
2414
for row_idx in range (rows_count):
2412
2415
for col_idx, array in enumerate (date_cols):
@@ -2428,14 +2431,15 @@ cdef cnp.ndarray[object] _concat_date_cols_sequence(tuple date_cols,
2428
2431
Py_ssize_t col_count,
2429
2432
bint keep_trivial_numbers):
2430
2433
"""
2431
- Concatenates `rows_count` elements from each `col_count` sequences
2432
- in `date_cols` into strings.
2434
+ Concatenates elements from sequences into strings.
2433
2435
2434
2436
Parameters
2435
2437
----------
2436
2438
date_cols : tuple of sequences
2437
2439
rows_count : Py_ssize_t
2440
+ count of elements from sequences that will be concatenated
2438
2441
col_count : Py_ssize_t
2442
+ count of sequences whose elements will be concatenated
2439
2443
keep_trivial_numbers : bool, default False
2440
2444
if True and len(date_cols) == 1, then
2441
2445
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,
2451
2455
object [:] result_view
2452
2456
2453
2457
result = np.zeros(rows_count, dtype = object )
2458
+
2454
2459
# create memoryview of result ndarray - more effecient indexing
2455
2460
result_view = result
2456
2461
0 commit comments