I am trying to append a value q at certain position of the 2d array using numpy
but I get an error at
line of code is:
a[r,c]='Q'
as
ValueError: could not convert string to float: Q
#!/bin/python
import sys
import numpy as np
#n=int(raw_input())
n,k = raw_input().strip().split(' ')
n,k = [int(n),int(k)]
a=np.zeros((n,n))
r,c = raw_input().strip().split(' ')
r,c = [int(r)-1,int(c)-1]
a[r,c]='Q' # ValueError: could not convert string to float: Q
print a