Text: machine learning
Write a function that returns a square 2D Numpy array having the structure shown in the examples given below. The function should take the size of the matrix as the argument.
Examples:
Input: 5
Output:
10101
01010
10101
01010
10101
Input: 10
Output:
1010101010
0101010101
1010101010
0101010101
1010101010
0101010101
1010101010
0101010101
1010101010
0101010101
Important notes:
Your code will be evaluated automatically. If you do not comply with the following rules, your grade will be zero.
You should write the algorithm yourself.
You are not allowed to use any readily available library function to perform the task described.
You should write your code as a single function that takes an integer and returns a 2D Numpy array as described.
In addition, you should name your function as "mat".