E
E
Efi2020-11-23 18:19:10
Python
Efi, 2020-11-23 18:19:10

How do I split an array element into lines using the numpy library, Python?

Hi,
I've only recently started to understand Python and for my small project I need to understand the numpy library, more specifically its two-dimensional lists.
I would be very grateful if you could help me understand this topic better, since I could not do it myself from the documentation.

Here is my array:

a = np.array().T


I've tried many variations (looping, numpy functions) but I haven't been able to do what I want.
The output array should look something like this:

['с', 'п', 'а', 'т', 'ь']
['д', 'ы', 'ш', 'а', 'т', 'ь']
['р', 'о', 'т', 'а']
['т', 'р', 'а', 'н', 'с', 'п', 'о', 'р', 'т']
['ж', 'и', 'т', 'ь']
['с', 'е', 'р', 'д', 'ц', 'е']


Thanks for any help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question