str2d.Str2D.join_v

classmethod Str2D.join_v(*args: Str2D, sep: str = '') Str2D[source]

join_v joins any number of Str2D objects vertically. The sep is the separator that will be added between the joined data.

Parameters:
  • args (Tuple[Str2D]) – The Str2D objects to join vertically.

  • sep (str, optional) – The separator to insert between the joined data, by default ‘’.

Returns:

A new Str2D object with the joined data.

Return type:

Str2D

See also

join_h

Join the data horizontally.

Examples

Let’s create several instances of Str2D and assign them to the variables a, b, and c.

from str2d import Str2D

a = Str2D('a b c d\ne f g\nh i\nj')
b = Str2D('1 2 3\n4 5 6\n7 8 9')
c = Str2D('x y z\nu v w\nq r s')

We can join the data vertically by passing the Str2D objects to the join_v

Str2D.join_v(a, b, c)
a b c d
e f g
h i
j
1 2 3
4 5 6
7 8 9
x y z
u v w
q r s

We can also pass a separator

Str2D.join_v(a, b, c, sep='-')
a b c d
e f g
h i
j
-------
1 2 3
4 5 6
7 8 9
-------
x y z
u v w
q r s