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 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.