File "<ipython-input-5-e17ca2a1bb52>", line 8 Y = np.array[4,1,0,1,4] ^ SyntaxError: invalid syntax

You need to pass the [] bracketed list as an argument to the np.array constructor, so () parentheses are needed:

Y = np.array([4, 1, 0, 1, 4])
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.