str2d.Str2D.v

property Str2D.v: Str2D

Return the vertical flip of the data.

This is one of 5 transformations that can be done to the Str2D object.

  • i is the identity transformation of the data.

  • t is the transpose of the data.

  • h is the horizontal flip of the data.

  • v is the vertical flip of the data.

  • r is the 90 degree clockwise rotation of the data.

Examples

Let’s create an instance of Str2D and assign it to the variable a.

from str2d import Str2D

a = Str2D('ab\ncd')
a
ab
cd

Notice that this is a 2x2 array. We’ll show each of the transformations and intentionally expand and box them to show how the transformations affect the alignment.

a.transormation_palette()
   i    |    t    |    h     |     v     |    r     |    r2     |    r3
╭────╮  | ╭────╮  |  ╭────╮  |  ╭────╮   |  ╭────╮  |  ╭────╮   |  ╭────╮
│ab  │  | │ac  │  |  │  ba│  |  │    │   |  │  ca│  |  │    │   |  │    │
│cd  │  | │bd  │  |  │  dc│  |  │    │   |  │  db│  |  │    │   |  │    │
│    │  | │    │  |  │    │  |  │cd  │   |  │    │  |  │  dc│   |  │bd  │
│    │  | │    │  |  │    │  |  │ab  │   |  │    │  |  │  ba│   |  │ac  │
╰────╯  | ╰────╯  |  ╰────╯  |  ╰────╯   |  ╰────╯  |  ╰────╯   |  ╰────╯
------- | ------- | -------- | --------- | -------- | --------- | ---------
v: top  | v: top  | v: top   | v: bottom | v: top   | v: bottom | v: bottom
h: left | h: left | h: right | h: left   | h: right | h: right  | h: left

Lastly, we can chain the transformations together.

a.thirvt
bd
ac