M
M
Moroz228482019-09-26 17:35:22
Python
Moroz22848, 2019-09-26 17:35:22

How to add numbers to multidimensional NumPy array in python via input()?

The code has a new_input variable that stores the values ​​​​of the numpy.array matrix, how to make it so that you can write your value to numpy.array through the console, like new_input = numpy.array( [ input() ] )?
Code for full understanding
new_input = np.array([])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2019-09-26
@longclaps

import numpy as np
from io import StringIO


a = np.loadtxt(StringIO(input('введи строку ''1 2'': ')))
print(a)

ps on likeness

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question