0

What is the difference between

train_x = np.asarray([[0.0], [1.0], [2.0], [3.0], [4.0]])
train_y = np.asarray([1.0, 1.1, 3.0, 2.0, 5.0])

in Python numpy.asarray assignment? What is the meaning of [] brakets in the first line?

Thank you.

0

1 Answer 1

0

The difference is creating a numpy array from a list of floats (1D) vs creating an array from a list of list of floats (2D)

Sign up to request clarification or add additional context in comments.

Comments