I want to concatenate integer and string value, where integer is in a 2D list and string is in a 1D list.
['VDM', 'MDM', 'OM']
The above mentions list is my string list.
[[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]
The above mentioned list is my integer list.
I have tried this code:
for i in range(numAttr):
for j in range(5):
abc=[[attr[i]+counts[i][j]]]
print(abc)
Here numAttr is the number of element in the first 1D list. and second 2D list is a static list i.e. for any dataset the 2D list will not change.
The above code showing the error:
TypeError: can only concatenate str (not "int") to str
I want a list output which looks like this:
[['VDM:1','VDM:2','VDM:3','VDM:4','VDM:5'],['MDM:1','MDM:2','MDM:3','MDM:4','MDM:5'],['OM:1','OM:2','OM:3','OM:4','OM:5']]