C
C
CeBePHblY2019-06-30 15:50:10
Python
CeBePHblY, 2019-06-30 15:50:10

How to load data using np.loadtxt?

I am writing a small neural network. There are two files, with input and output. In the output file, the data is located like this:

spoiler
1
0
0
1

I extract the data like this: as a result, y contains such data
y = np.loadtxt('true_data1.txt', dtype=int)
spoiler
[1 0 0 1]

How can I convert them to this form?
spoiler
[1]
[0]
[0]
[1]

yT doesn't help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny Kravchenko, 2019-06-30
@CeBePHblY

y.reshape(-1, 1)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question