Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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.
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)
Add a comment