str2d.Str2D.fill_with

Str2D.fill_with(char=' ') Str2D[source]

Fill the data with the character. This is a wrapper around the fill method from the structured array data.

Parameters:

char (str, optional) – The character to fill with, by default ‘ ‘.

Returns:

A new Str2D object with the data filled with the character.

Return type:

Str2D

See also

hide

Hide the data.

Examples

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

from str2d import Str2D

a = Str2D('abcdefg\nhijklm\nnopqr\nstuv\nwxy\nz')
a
abcdefg
hijklm
nopqr
stuv
wxy
z

We can fill the data with a character.

a.fill_with(char='.')

abcdefg
hijklm.
nopqr..
stuv...
wxy....
z......