@@ -303,23 +303,24 @@ The same alignment can be used when ``others`` is a ``DataFrame``:
303
303
Concatenating a Series and many objects into a Series
304
304
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
305
305
306
- All one-dimensional list-likes can be combined in a list-like container (including iterators, ``dict ``-views, etc.):
306
+ Several array-like items (specifically: ``Series ``, ``Index ``, and 1-dimensional variants of ``np.ndarray ``)
307
+ can be combined in a list-like container (including iterators, ``dict ``-views, etc.).
307
308
308
309
.. ipython :: python
309
310
310
311
s
311
312
u
312
- s.str.cat([u.array,
313
- u.index.astype(str ).array], na_rep = ' -' )
313
+ s.str.cat([u, u.to_numpy()], join = ' left' )
314
314
315
- All elements must match in length to the calling ``Series `` (or ``Index ``), except those having an index if ``join `` is not None:
315
+ All elements without an index (e.g. ``np.ndarray ``) within the passed list-like must match in length to the calling ``Series `` (or ``Index ``),
316
+ but ``Series `` and ``Index `` may have arbitrary length (as long as alignment is not disabled with ``join=None ``):
316
317
317
318
.. ipython :: python
318
319
319
320
v
320
- s.str.cat([u, v ], join = ' outer' , na_rep = ' -' )
321
+ s.str.cat([v, u, u.to_numpy() ], join = ' outer' , na_rep = ' -' )
321
322
322
- If using ``join='right' `` on a list of ``others `` that contains different indexes,
323
+ If using ``join='right' `` on a list-like of ``others `` that contains different indexes,
323
324
the union of these indexes will be used as the basis for the final concatenation:
324
325
325
326
.. ipython :: python
0 commit comments