<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Import the numpy package under the name np
Step1:  2. Create a null vector Z of size 10. Don't use [0, 0, ...] notation.
Step2:  3.  Create a null vector of size 10 but the fifth value which is 1
Step3:  4.  Create a Numpy vector with values ranging from 10 to 49
Step4:  5.  Reverse the vector from the previous task (first element becomes last)
Step5:  6.  Create a 3x3 matrix with values ranging from 0 to 8
Step6:  7. Find the indices of non-zero elements from [1,2,0,0,4,0] and store the result in nz
Step7:  8. Create a 3x3x3 (i.e. three dimensions with three values each) array with random values invariable Z
Step8:  13. Create a 10x10 array with random values and find the minimum and maximum values and store them in Zmin and Zmax.
Step9:  14. Create a random vector of size 30 and find the mean value using Numpy. Store the result into mean
Step10:  15. Create a 8x8 matrix and fill it with a chessboard pattern (say, 1 == 'black' and 0 == 'white'). Use fancy indexing.
Step11:  16. Multiply a 5x3 matrix by a 3x2 matrix (real matrix product)
Step12:  17. Given a array np.arange(11), negate all elements which are between 3 and 8, in place.
<ASSISTANT_TASK:>
Python Code:
import numpy as np
try:
    np
except NameError:
    print('Numpy not correctly imported')
Explanation: Import the numpy package under the name np
End of explanation
Z = np.zeros(10)
print(Z)
assert type(Z).__module__ == np.__name__
assert len(Z) == 10
assert sum(Z) == 0
Explanation: 2. Create a null vector Z of size 10. Don't use [0, 0, ...] notation.
End of explanation
Z = np.zeros(10)
Z[4] = 1
print(Z)
assert type(Z).__module__ == np.__name__
assert len(Z) == 10
assert sum(Z) == 1
Explanation: 3.  Create a null vector of size 10 but the fifth value which is 1
End of explanation
Z = np.arange(10,50)
print(Z)
assert type(Z).__module__ == np.__name__
assert len(Z) == 40
assert sum(Z) == 1180
Explanation: 4.  Create a Numpy vector with values ranging from 10 to 49
End of explanation
Z = Z[::-1]
print(Z)
assert type(Z).__module__ == np.__name__
assert len(Z) == 40
assert sum(Z) == 1180
assert Z[0] == 49
assert Z[-1] == 10
Explanation: 5.  Reverse the vector from the previous task (first element becomes last)
End of explanation
Z = np.arange(9).reshape(3,3)
print(Z)
assert Z.shape == (3, 3)
assert np.all(sum(Z) == np.array([9, 12, 15]))
Explanation: 6.  Create a 3x3 matrix with values ranging from 0 to 8
End of explanation
nz = np.array([1,2,0,0,4,0])
nz = (nz[nz != 0])
assert np.all(nz == np.array([1, 2, 4]))
Explanation: 7. Find the indices of non-zero elements from [1,2,0,0,4,0] and store the result in nz
End of explanation
Z = np.random.random((3,3,3))
print(Z)
assert Z.shape == (3, 3, 3)
Explanation: 8. Create a 3x3x3 (i.e. three dimensions with three values each) array with random values invariable Z
End of explanation
Z = np.random.random((10,10))
Zmin, Zmax = Z.min(), Z.max()
print(Zmin, Zmax)
z = Z.ravel()
idx = z.argsort()
assert z[idx[0]] == Zmin
assert z[idx[-1]] == Zmax
Explanation: 13. Create a 10x10 array with random values and find the minimum and maximum values and store them in Zmin and Zmax.
End of explanation
Z = np.random.random(30)
mean = Z.mean()
print(mean)
accumulative = 0
for z in Z:
    accumulative += z
assert mean - (accumulative/len(Z)) < 0.0001
Explanation: 14. Create a random vector of size 30 and find the mean value using Numpy. Store the result into mean
End of explanation
Z = np.zeros((8,8), dtype=int)
Z[1::2,::2] = 1
Z[::2,1::2] = 1
print(Z)
Explanation: 15. Create a 8x8 matrix and fill it with a chessboard pattern (say, 1 == 'black' and 0 == 'white'). Use fancy indexing.
End of explanation
Z = np.dot(np.ones((5,3)), np.ones((3,2)))
print(Z)
Explanation: 16. Multiply a 5x3 matrix by a 3x2 matrix (real matrix product)
End of explanation
Z = np.arange(11)
Z[(3 < Z) & (Z <= 8)] *= -1
print(Z)
Explanation: 17. Given a array np.arange(11), negate all elements which are between 3 and 8, in place.
End of explanation
<END_TASK>