<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Numpy Exercise 1
Imports
Step2:  Checkerboard
Write a Python function that creates a square (size,size) 2d Numpy array with the values 0.0 and 1.0
Step3:  Use vizarray to visualize a checkerboard of size=20 with a block size of 10px.
Step4:  Use vizarray to visualize a checkerboard of size=27 with a block size of 5px.
<ASSISTANT_TASK:>
Python Code:
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import antipackage
import github.ellisonbg.misc.vizarray as va
Explanation: Numpy Exercise 1
Imports
End of explanation
def checkerboard(size):
    Return a 2d checkboard of 0.0 and 1.0 as a NumPy array
    check = np.zeros((size,size),float)
    check.fill(0.0)
    n = 0
    while n<(size):
        if n % 2 == 0: #For even number rows, start filling 1's at position 0
            p = 0
        else:         #For odd number rows, start filling 1's at position 1
            p = 1
        while p<(size):
            check[n,p] = (1.0)  #Fill 1's at position n,p
            p = p + 2    #Skip one position in row before filling in a row (Key to the checkerboard pattern)
        n = n + 1  #Move to next row
        
    return check
#print (checkerboard(7))    #Was used to test output
#raise NotImplementedError()
a = checkerboard(4)
assert a[0,0]==1.0
assert a.sum()==8.0
assert a.dtype==np.dtype(float)
assert np.all(a[0,0:5:2]==1.0)
assert np.all(a[1,0:5:2]==0.0)
b = checkerboard(5)
assert b[0,0]==1.0
assert b.sum()==13.0
assert np.all(b.ravel()[0:26:2]==1.0)
assert np.all(b.ravel()[1:25:2]==0.0)
Explanation: Checkerboard
Write a Python function that creates a square (size,size) 2d Numpy array with the values 0.0 and 1.0:
Your function should work for both odd and even size.
The 0,0 element should be 1.0.
The dtype should be float.
End of explanation
va.set_block_size(10)
va.vizarray(checkerboard(20))
#raise NotImplementedError()
assert True
Explanation: Use vizarray to visualize a checkerboard of size=20 with a block size of 10px.
End of explanation
va.set_block_size(5)
va.vizarray(checkerboard(27))
#raise NotImplementedError()
assert True
Explanation: Use vizarray to visualize a checkerboard of size=27 with a block size of 5px.
End of explanation
<END_TASK>