To add more labels to a dtype=uint8
array in Python using NumPy, you can assign the values directly to the array elements. Here is an example:
main.py191 chars13 lines
Output:
main.py231 chars11 lines
In this example, the array arr
is created as a 10x10 uint8 array filled with zeros. Then, labels 1, 2, and 3 are assigned to specific elements in the array (e.g., arr[2, 3] = 1
). Finally, the array is printed to verify the labels have been added correctly.
gistlibby LogSnag