The idea here is to dynamically increase the size (rows X columns) of an array (using hstack and vstack). However, I do not know the length of the strings that are about to be written at a specific position of the array at the moment I have to increase the size. Thus, the unknown elements are initialized with e.g. ' ' or 0 or something similar.
This leads to an error, if the placeholders are too short:
x = array([["1;", "2;"],["3;", "4;"]])
x[0][0] = "1234567890;"
print x
delivers:
[['12' '2;']
['3;' '4;']]
Many characters are missing at the position [0][0], whereas
x = array([["1;", "2;"],["abcdefghij;", "4;"]])
x[0][0] = "1234567890;"
print x
delivers the desired result, i.e.:
[['1234567890;' '2;']
['abcdefghij;' '4;']]
How can we handle this in Python? Many thanks in advance!